package com.syni.mdd.sjb.common.datatreaure.service.impl;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.syni.mdd.sjb.common.component.mybatis.common.entity.DxshAppUserInfo;
import com.syni.mdd.sjb.common.component.mybatis.dxshapp.entity.*;
import com.syni.mdd.sjb.common.component.mybatis.dxshapp.entity.customBo.DxshAppUserChannelBo;
import com.syni.mdd.sjb.common.component.mybatis.dxshapp.mapper.DxshAppUserChannelMapper;
import com.syni.mdd.sjb.common.component.utils.common.entity.BmsCdnData;
import com.syni.mdd.sjb.common.component.utils.common.spring.ApplicationContextHolder;
import com.syni.mdd.sjb.common.component.utils.common.utils.*;
import com.syni.mdd.sjb.common.component.utils.feign.dto.mddAll.apiBusiness.*;
import com.syni.mdd.sjb.common.component.utils.feign.dto.mddAll.apiBusinessInfo.GetBusinessInfoDto;
import com.syni.mdd.sjb.common.component.utils.feign.dto.mddUser.apiUser.GetMidongdongUserDto;
import com.syni.mdd.sjb.common.component.utils.feign.service.mdd.commonuser.UserMerchantsRelationRestService;
import com.syni.mdd.sjb.common.component.utils.feign.service.mdd.commonuser.UserRestService;
import com.syni.mdd.sjb.common.component.utils.feign.service.mdd.commonuser.UserRoleRestService;
import com.syni.mdd.sjb.common.component.utils.feign.service.mddAll.*;
import com.syni.mdd.sjb.common.component.utils.feign.service.synimerchants.SyniMerchantsAccountRestService;
import com.syni.mdd.sjb.common.datatreaure.constants.Constants;
import com.syni.mdd.sjb.common.datatreaure.constants.ResultCode;
import com.syni.mdd.sjb.common.datatreaure.constants.ResultMsg;
import com.syni.mdd.sjb.common.datatreaure.controller.protect.dataTreasure.business.BankBusinessController;
import com.syni.mdd.sjb.common.datatreaure.entity.bo.apiNews.MinAppNewsBo;
import com.syni.mdd.sjb.common.datatreaure.entity.bo.dataBankBusiness.BankBusinessBo;
import com.syni.mdd.sjb.common.datatreaure.entity.bo.databankUser.MerchantsUserInfoBo;
import com.syni.mdd.sjb.common.datatreaure.entity.bo.userChannel.ChannelBo;
import com.syni.mdd.sjb.common.datatreaure.entity.bo.userChannel.GetMinAppTemplListBo;
import com.syni.mdd.sjb.common.datatreaure.entity.bo.userChannel.QuickAccessBo;
import com.syni.mdd.sjb.common.datatreaure.entity.dto.minapp.EditMinAppInfoDto;
import com.syni.mdd.sjb.common.datatreaure.entity.dto.minapp.MinAppDataDto;
import com.syni.mdd.sjb.common.datatreaure.entity.dto.minapp.MinAppDto;
import com.syni.mdd.sjb.common.datatreaure.entity.dto.userChannel.GetBusinessEarningsDto;
import com.syni.mdd.sjb.common.datatreaure.entity.dto.userChannel.SearchBusinessToClaimDto;
import com.syni.mdd.sjb.common.datatreaure.entity.vo.rp.index.DataRpVo;
import com.syni.mdd.sjb.common.datatreaure.entity.vo.rp.service.BannerRpVo;
import com.syni.mdd.sjb.common.datatreaure.entity.vo.rp.userChannel.*;
import com.syni.mdd.sjb.common.datatreaure.entity.vo.rq.BaseRqVo;
import com.syni.mdd.sjb.common.datatreaure.entity.vo.rq.databank.DataBankBusinessVo;
import com.syni.mdd.sjb.common.datatreaure.entity.vo.rq.userChannel.*;
import com.syni.mdd.sjb.common.datatreaure.exception.SystemErrorException;
import com.syni.mdd.sjb.common.datatreaure.listen.userChannel.MinAppUserChannelRecordEvent;
import com.syni.mdd.sjb.common.datatreaure.mybatis.MybatisUtils;
import com.syni.mdd.sjb.common.datatreaure.service.*;
import com.syni.mdd.sjb.common.datatreaure.service.databank.DataBankBusinessService;
import com.syni.mdd.sjb.common.datatreaure.service.databank.DataBankUserService;
import io.seata.spring.annotation.GlobalTransactional;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.map.LinkedMap;
import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.io.InputStreamReader;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * <p>
 * 电享生活app用户渠道表 服务实现类
 * </p>
 *
 * @author cfx
 * @since 2020-04-21
 */
@Service
@Log4j2
public class DxshAppUserChannelServiceImpl extends ServiceImpl<DxshAppUserChannelMapper, DxshAppUserChannel> implements DxshAppUserChannelService {
    @Value("${properties.file.tmp}")
    private String tmpDirectory;

    @Autowired
    DxshAppUserChannelMapper dxshAppUserChannelMapper;

    @Autowired
    BusinessRestService businessRestService;

    @Autowired
    BusinessAuthRestService businessAuthRestService;

    @Autowired
    BusinessInfoRestService businessInfoRestService;

    @Autowired
    DxshAppIndustryService dxshAppIndustryService;

    @Autowired
    DxshAppMinappAuthService dxshAppMinappAuthService;

    @Autowired
    BmsBusinessService bmsBusinessService;

    @Autowired
    PcBankDataService pcBankDataService;

    @Autowired
    UserRestService userRestService;

    @Autowired
    DxshAppBannerService dxshAppBannerService;

    @Autowired
    BmsBusinessTypeService bmsBusinessTypeService;
    @Autowired
    BmsDxClientRoleService bmsDxClientRoleService;

    @Autowired
    BmsUserBusinessService bmsUserBusinessService;

    @Autowired
    UserRoleRestService userRoleRestService;

    @Autowired
    DxshAppIndustryChildService dxshAppIndustryChildService;

    @Value("classpath:bank.json")
    private Resource resource;

    @Autowired
    UserMerchantsRelationRestService userMerchantsRelationRestService;

    @Autowired
    SyniMerchantsAccountRestService syniMerchantsAccountRestService;

    @Autowired
    DxshAppUserInfoService dxshAppUserInfoService;

    @Autowired
    DxshAppIndustryChooseService dxshAppIndustryChooseService;

    @Autowired
    BusinessTypeRestService businessTypeRestService;

    @Autowired
    DataBankBusinessService dataBankBusinessService;

    @Autowired
    DankMerchantsDefBusinessService dankMerchantsDefBusinessService;

    @Autowired
    ApiConfigRestService apiConfigRestService;

    @Autowired
    DxshAppNewsService dxshAppNewsService;

    @Autowired
    DxshAppMinappInfoService dxshAppMinappInfoService;

    @Autowired
    DataBankUserService dataBankUserService;


    private Map<String,GetMinAppTemplListBo> getMinAppTemplListBoMap = new HashMap<>();

    private static Map<String,JSONObject> minAppFastPortMap = new HashMap<>();

    @Value("${minAppFastPort}")
    public void setMinAppFastPortMap(String mdata) {
        JSONArray jsonArray = JSON.parseArray(mdata);
        if(jsonArray.size() > 0){
            for(int ii = 0;ii < jsonArray.size();ii++){
                JSONObject jsonObject = jsonArray.getJSONObject(ii);
                minAppFastPortMap.put(jsonObject.getString("name"),jsonObject);
            }
        }
    }

//    static {
//        minAppFastPortMap.put("首页设置", "http://dsp-1251624226.cos.ap-guangzhou.myqcloud.com/business/b202011251808186481C28.png");
//        minAppFastPortMap.put("配送设置", "http://dsp-1251624226.cos.ap-guangzhou.myqcloud.com/business/b20201126140748296k518.png");
//        minAppFastPortMap.put("充值订单", "http://dsp-1251624226.cos.ap-guangzhou.myqcloud.com/business/b202011261409435230D3u.png");
//        minAppFastPortMap.put("预订订单", "http://dsp-1251624226.cos.ap-guangzhou.myqcloud.com/business/b202011261410278743553.png");
//        minAppFastPortMap.put("堂食订单", "http://dsp-1251624226.cos.ap-guangzhou.myqcloud.com/business/b202011261410278743553.png");
//        minAppFastPortMap.put("堂食商品", "http://dsp-1251624226.cos.ap-guangzhou.myqcloud.com/business/b202011261410278743553.png");
//        minAppFastPortMap.put("外卖订单", "http://dsp-1251624226.cos.ap-guangzhou.myqcloud.com/business/b202011261410278743553.png");
//        minAppFastPortMap.put("外卖商品", "http://dsp-1251624226.cos.ap-guangzhou.myqcloud.com/business/b202011261410278743553.png");
//    }

    @Override
    public Map<String, Object> getMyChannel(GetMyChannelVo getMyChannelVo) {
        Integer businessRole = bmsDxClientRoleService.getRoleId(getMyChannelVo.getUserId());
        Page<DxshAppUserChannel> page = new Page<>(getMyChannelVo.getPageNum(),getMyChannelVo.getPageSize());
        QueryWrapper<DxshAppUserChannel> queryWrapper = new QueryWrapper();
        queryWrapper.eq(DxshAppUserChannel.USER_ID,getMyChannelVo.getUserId());
//        queryWrapper.eq(DxshAppUserChannel.IS_FILL,Constants.COMMON_FLAG_TRUE_INT);
        queryWrapper.orderByDesc(DxshAppUserChannel.IS_FILL + "=1");
        queryWrapper.orderByAsc(DxshAppUserChannel.NEW_TIME);
        IPage<DxshAppUserChannel> dxshAppUserChannelBoIPage = dxshAppUserChannelMapper.selectPage(page,queryWrapper);
        List<DxshAppUserChannel> dxshAppUserChannelList = new ArrayList<>();
        Map<String,Object> userData = null;
        if(Constants.MDD_DY_ROLE_ID == businessRole){
            pushDYChannel(dxshAppUserChannelList,getMyChannelVo.getUserId());
            userData = MybatisUtils.UserData(getMyChannelVo.getPageNum(),getMyChannelVo.getPageSize(),dxshAppUserChannelList.size());
        }else{
            dxshAppUserChannelList = dxshAppUserChannelBoIPage.getRecords();
            userData = MybatisUtils.UserData(dxshAppUserChannelBoIPage);
        }

        List<BannerRpVo> bannerRpVoList = dxshAppBannerService.bannerList(DxshAppBannerService.CHANNEL_ALL_TYPE);
        userData.put("banner",bannerRpVoList);

        if(dxshAppUserChannelList.size() > 0){
            List<ChannelBo> channelBoList = BeanUtils.copyList(dxshAppUserChannelList,ChannelBo.class);
            //处理觅东东
            GetMddBusinessDataByDxshAppDto getMddBusinessDataByDxshAppDto = new GetMddBusinessDataByDxshAppDto();

            Set<Integer> businessIds = channelBoList.stream()
                    .filter(v->CHANNEL_MDD == v.getChannel()  && v.getBusinessId()!=null)
                    .map(DxshAppUserChannel::getBusinessId).collect(Collectors.toSet());

            getMddBusinessDataByDxshAppDto.setBusinessIds(businessIds);
            RpcResponseVo rpcResponseVo = businessRestService.getMddBusinessDataByDxshApp(getMddBusinessDataByDxshAppDto);
            if(rpcResponseVo.isSuccess()){
                getMddBusinessDataByDxshAppDto = rpcResponseVo.parseObject(GetMddBusinessDataByDxshAppDto.class);
                for(ChannelBo q:channelBoList){
                    for(GetMddBusinessDataByDxshAppDto.BusinessDataDto dto:getMddBusinessDataByDxshAppDto.getBusinessDatas()){
                        if( q.getChannel()==CHANNEL_MDD && q.getBusinessId().equals( dto.getBusinessId()) ){
                            q.setVendorName(dto.getVendorName());
                            q.setLoginUrl(dto.getLoginUrl());
                            if(Constants.MDD_DY_ROLE_ID != businessRole){
                                q.setGroupBuyNum(dto.getGroupBuyNum());
                                q.setVerNum(dto.getVerNum());
                            }
                        }
                    }
                }

            }
            //处理小程序
            Set<String> minAppIds = channelBoList.stream()
                    .filter(v->CHANNEL_MINAPP == v.getChannel() && v.getMinAppId() != null && v.getIsFill() == Constants.COMMON_FLAG_TRUE_INT)
                    .map(DxshAppUserChannel::getMinAppId).collect(Collectors.toSet());
            Iterator iterator = minAppIds.iterator();
            while(iterator.hasNext()){
                String minAppId = iterator.next().toString();
                if(!PatternMatchUtils.isNumeric(minAppId)){
                    iterator.remove();
                }
            }
            if(minAppIds.size() > 0) {
                String url = AppConfig.getProperty("saas.dxshapp.center.service") + "/dxshApp/app/getByStoreIds";;
                String token = RequestHeaderData.getRequestHeaderData().getString("token");
                RpcResponseVo minrpcResponseVo = userRestService.getMiniTokenByUserId_v2(getMyChannelVo.getUserId(), token);
                if (minrpcResponseVo.isSuccess()) {
                    String minitoken = minrpcResponseVo.getData().toString();
                    try {
                        String requestBody = RestTemplateUtils.postForEntityForJsonByLoadBalanced(url, minAppIds, RestTemplateUtils.getSassHeader(minitoken));
                        JSONObject userJson = JSON.parseObject(requestBody);
                        if (userJson.containsKey("status") && ResultCode.CODE_NORMAL.equals(userJson.getString("status"))) {
                            JSONObject result = (JSONObject) userJson.get("data");
                            if (result != null) {
                                for (ChannelBo q : channelBoList) {
                                    if (q.getChannel() == CHANNEL_MINAPP && StringUtils.checkAnyNotNull(q.getMinAppId()) && result.containsKey(q.getMinAppId())) {
                                        MinAppDto minAppDto = JSON.parseObject(result.getString(q.getMinAppId()), MinAppDto.class);
                                        System.out.println(minAppDto);
                                        q.setVendorName(minAppDto.getName());
                                        q.setOrderNum(minAppDto.getAppOrderCountData().getTodayOrderQuantity());
                                        q.setTurnover(minAppDto.getAppOrderCountData().getTodayOrderSum());
                                        q.setAppStatus(minAppDto.getStatus());
                                        q.setWxReleaseStatus(minAppDto.getWxReleaseStatus());
                                        q.setWxReleaseStep(minAppDto.getWxReleaseStep());
                                        if (q.getAppStatus() == Constants.MINAPP_STATUS_CREATE_ING) {
                                            q.setAppStatus(Constants.MINAPP_STATUS_CREATE_SUCCESS);
                                        }
                                        q.setLoginUrl(minAppDto.getLogo());
                                    }
                                }
                            }
                        }
                    } catch (Exception e) {
                        log.error(e.getMessage(), e);
                    }
                }
            }
            channelBoList.forEach(bo->{
                dxshAppIndustryService.postHandleUserChannel(bo);
                bo.setBusinessRole(businessRole);
            });
            List<ChannelRpVo> channelRpVoList = BeanUtils.copyList(channelBoList,ChannelRpVo.class);
            return ResultMapHelper.success(channelRpVoList,userData,ResultMsg.MSG_GET_SUCCESS);
        }
        return ResultMapHelper.success(null,userData,ResultMsg.MSG_GET_SUCCESS);

//        Integer userId = getMyChannelVo.getUserId();
//        QueryWrapper<DxshAppUserChannel> queryWrapper = new QueryWrapper();
//        queryWrapper.eq(DxshAppUserChannel.USER_ID,userId);
//        queryWrapper.groupBy(DxshAppUserChannel.CHANNEL,DxshAppUserChannel.USER_ID);
//        System.out.println(queryWrapper.getCustomSqlSegment());
//        List<DxshAppUserChannelBo> bos = dxshAppUserChannelMapper.getUserChannelGroupByType(queryWrapper);
//        if(bos.size() > 0){
//            for(DxshAppUserChannelBo bo : bos) {
//                //组装小程序订单量
//                //组装店铺订单量和成交金额
//                if(bo.getChannel().equals(CHANNEL_MDD)){
//                    RpcResponseVo rpcResponseVo = businessRestService.getBusinessEarnings(userId);
//                    if(rpcResponseVo.isSuccess()){
//                        GetBusinessEarningsDto getBusinessEarningsDto = rpcResponseVo.parseObject(GetBusinessEarningsDto.class);
//                        bo.setVerNum(getBusinessEarningsDto.getVerNum());
//                        bo.setTurnover(getBusinessEarningsDto.getTurnover());
//                    }
//                }
//            }
//        }
//        List<GetMyChannelRpVo> getMyChannelRpVo = BeanUtils.copyList(bos,GetMyChannelRpVo.class);
//        return ResultMapHelper.success(getMyChannelRpVo, ResultMsg.MSG_GET_SUCCESS);
    }

    @Override
    public List<DxshAppUserChannelBo> getUserChannelGroupByType(Integer userId) {
        Integer businessRole = bmsDxClientRoleService.getRoleId(userId);
        QueryWrapper<DxshAppUserChannel> queryWrapper = new QueryWrapper();
        queryWrapper.eq(DxshAppUserChannel.USER_ID,userId);
        queryWrapper.eq(DxshAppUserChannel.IS_FILL,Constants.COMMON_FLAG_TRUE_INT);
        queryWrapper.groupBy(DxshAppUserChannel.CHANNEL);
        List<DxshAppUserChannelBo> bos =  dxshAppUserChannelMapper.getUserChannelGroupByType(queryWrapper);

        if(bos.size() > 0){
            for(DxshAppUserChannelBo bo : bos) {
                //组装小程序订单量
                if(bo.getChannel().equals(CHANNEL_MINAPP)){
                    //TODO:调用小程序接口获取今日订单量和营业额
                    String url = AppConfig.getProperty("saas.dxshapp.center.service")+"/dxshApp/app/appCount";
                    String token = RequestHeaderData.getRequestHeaderData().getString("token");
                    RpcResponseVo rpcResponseVo = userRestService.getMiniTokenByUserId_v2(userId,token);
                    if(rpcResponseVo.isSuccess()){
                        try {
                            String minitoken = rpcResponseVo.getData().toString();
                            log.info("mintoken" + minitoken);
                            String requestBody = RestTemplateUtils.postForEntityForJsonByLoadBalanced(url,null,RestTemplateUtils.getSassHeader(minitoken));
                            JSONObject userJson = JSON.parseObject(requestBody);
                            if(userJson.containsKey("status") && ResultCode.CODE_NORMAL.equals(userJson.getString("status"))){
                                MinAppDataDto minAppDataDto = JSON.parseObject(userJson.get("data").toString(),MinAppDataDto.class);
                                if(minAppDataDto != null){
                                    bo.setNum(minAppDataDto.getAppQuantity());
                                    bo.setVerNum(minAppDataDto.getTodayOrderQuantity());
                                    bo.setTurnover(minAppDataDto.getTodayOrderSum());
                                }
                            }
                        }catch (Exception e){
                            log.error(e.getMessage(),e);
                        }
                    }else {
                        log.info("rpcResponseVo:" + rpcResponseVo.toString());
                    }
                }
                //组装店铺订单量和成交金额
                if(bo.getChannel().equals(CHANNEL_MDD)){
                    if(businessRole == Constants.MDD_DY_ROLE_ID){
                        List<DxshAppUserChannel> dxshAppUserChannelList = new ArrayList<>();
                        pushDYChannel(dxshAppUserChannelList,userId);
                        bo.setNum(dxshAppUserChannelList.size());
                    }
                    RpcResponseVo mddrpcResponseVo = businessRestService.getBusinessEarnings(userId);
                    if(mddrpcResponseVo.isSuccess()){
                        GetBusinessEarningsDto getBusinessEarningsDto = mddrpcResponseVo.parseObject(GetBusinessEarningsDto.class);
                        bo.setVerNum(getBusinessEarningsDto.getVerNum());
                        bo.setTurnover(getBusinessEarningsDto.getTurnover());
                    }
                }
            }
        }else{
            if(businessRole == Constants.MDD_DY_ROLE_ID){
                List<DxshAppUserChannel> dxshAppUserChannelList = new ArrayList<>();
                pushDYChannel(dxshAppUserChannelList,userId);
                DxshAppUserChannelBo dxshAppUserChannelBo = new DxshAppUserChannelBo();
                dxshAppUserChannelBo.setNum(dxshAppUserChannelList.size());
                dxshAppUserChannelBo.setChannel(DxshAppUserChannelService.CHANNEL_MDD);
                dxshAppUserChannelBo.setTurnover(0.0);
                dxshAppUserChannelBo.setVerNum(0);
                bos.add(dxshAppUserChannelBo);
            }
        }
        return bos;
    }

    @Override
    public Map<String,Object> searchBusinessToClaim(SearchBusinessToClaimVo searchBusinessToClaimVo) {
        if(StringUtils.isBlank(searchBusinessToClaimVo.getAddrCity())){
            searchBusinessToClaimVo.setAddrCity("");
        }
        if(StringUtils.isBlank(searchBusinessToClaimVo.getSearchText())){
            searchBusinessToClaimVo.setSearchText("");
        }
        String typeName = "";
        //如果选择了行业
        DxshAppIndustry dxshAppIndustry = dxshAppIndustryChooseService.getUserChooseInIndustry(searchBusinessToClaimVo.getUserId());
        if(dxshAppIndustry != null){
            String industryName = dxshAppIndustry.getIndustryName();
            log.info("industryName:{}",industryName);
            if(BankBusinessController.typeIndustryMap.containsKey(industryName)){
                typeName = JSON.toJSONString(BankBusinessController.typeIndustryMap.get(industryName));
            }
        }
        RpcResponseVo rpcResponseVo;
        if(StringUtils.isNotBlank(typeName)) {
            rpcResponseVo = businessRestService.getCanClaimBusiness(searchBusinessToClaimVo.getAddrProvince(),
                    searchBusinessToClaimVo.getAddrCity(),
                    searchBusinessToClaimVo.getSearchText(), typeName,
                    searchBusinessToClaimVo.getPageNum(), searchBusinessToClaimVo.getPageSize());
        }else {
            rpcResponseVo = businessRestService.getCanClaimBusinessNoTypeName(searchBusinessToClaimVo.getAddrProvince(),
                    searchBusinessToClaimVo.getAddrCity(),
                    searchBusinessToClaimVo.getSearchText(),
                    searchBusinessToClaimVo.getPageNum(), searchBusinessToClaimVo.getPageSize());
        }
        List<SearchBusinessToClaimDto> searchBusinessToClaimDtos = new LinkedList<>();
        if(rpcResponseVo.isSuccess()){
            searchBusinessToClaimDtos = rpcResponseVo.parseArray(SearchBusinessToClaimDto.class);
        }
        List<SearchBusinessToClaimRpVo> searchBusinessToClaimRpVos = BeanUtils.copyList(searchBusinessToClaimDtos,SearchBusinessToClaimRpVo.class);
        return ResultMapHelper.success(searchBusinessToClaimRpVos,rpcResponseVo.getUserData(),ResultMsg.MSG_GET_SUCCESS);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public Map<String, Object> doClaimBusiness(ClaimBusinessVo claimBusinessVo) {
        Boolean flag = bmsDxClientRoleService.isDianyuanRole(claimBusinessVo.getUserId());
        if(flag){
            return ResultMapHelper.failure("对不起，你没有资格认领店铺");
        }
        //判断该店铺是否被认领
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq(DxshAppUserChannel.BUSINESS_ID,claimBusinessVo.getBusinessId());
        List<DxshAppUserChannel> dxshAppUserChannels = dxshAppUserChannelMapper.selectList(queryWrapper);
        if(CollectionUtils.isNotEmpty(dxshAppUserChannels)){
            return ResultMapHelper.result(ResultCode.CODE_ERROR_100,"该店铺已被认领,请联系管理人员协商");
        }
        ClaimBusinessDto claimBusinessDto = new ClaimBusinessDto();

        claimBusinessDto.setUserId(claimBusinessVo.getUserId());
        claimBusinessDto.setInvitationCode(claimBusinessVo.getInvitationCode());
        claimBusinessDto.setBusinessId(claimBusinessVo.getBusinessId());
        RpcResponseVo rpcResponseVo = businessRestService.claimBusiness(claimBusinessDto);
        if (!rpcResponseVo.isSuccess()) {
            return ResultMapHelper.result(ResultCode.CODE_ERROR_100,rpcResponseVo.getMsg());
            //保存一条这边的记录
        }
        claimBusinessDto = rpcResponseVo.parseObject(ClaimBusinessDto.class);
        DxshAppUserChannel dxshAppUserChannel = new DxshAppUserChannel();
        dxshAppUserChannel.setBusinessAuthId(claimBusinessDto.getId());
        dxshAppUserChannel.setUserId(claimBusinessVo.getUserId());
        dxshAppUserChannel.setBusinessId(claimBusinessVo.getBusinessId());
        dxshAppUserChannel.setChannel(claimBusinessVo.getChannel());
        dxshAppUserChannel.setIsShow(Constants.COMMON_FLAG_FALSE_INT);
        dxshAppUserChannel.setNewTime(LocalDateTime.now());
        dxshAppUserChannel.setIsFill(DxshAppUserChannelService.IS_FILL_CODE_4);
        dxshAppUserChannelMapper.insert(dxshAppUserChannel);
        //如果是小程序 资质使用另外一个表创建
        if(claimBusinessVo.getChannel() == DxshAppUserChannelService.CHANNEL_MINAPP){
            DxshAppMinappAuth dxshAppMinappAuth = dxshAppMinappAuthService.createAuth(claimBusinessVo.getUserId(),claimBusinessVo.getBusinessId(),dxshAppUserChannel.getId());
            dxshAppUserChannel.setBusinessAuthId(dxshAppMinappAuth.getId());
            dxshAppUserChannel.setIsFill(Constants.COMMON_FLAG_FALSE_INT);
            dxshAppUserChannelMapper.updateById(dxshAppUserChannel);
        }


        return ResultMapHelper.success(null, ResultMsg.HAND_SUCCESS);

    }


    @Override
    @Transactional(rollbackFor = Exception.class)
    public Map<String, Object> doClaimBusiness_v2(ClaimBusinessVo claimBusinessVo) {
        Boolean flag = bmsDxClientRoleService.isDianyuanRole(claimBusinessVo.getUserId());
        if(flag){
            return ResultMapHelper.failure("对不起，你没有资格认领店铺");
        }
        //判断该店铺是否被认领
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq(DxshAppUserChannel.BUSINESS_ID,claimBusinessVo.getBusinessId());
        List<DxshAppUserChannel> dxshAppUserChannels = dxshAppUserChannelMapper.selectList(queryWrapper);
        if(CollectionUtils.isNotEmpty(dxshAppUserChannels)){
            return ResultMapHelper.result(ResultCode.CODE_ERROR_100,"该店铺已被认领,请联系管理人员协商");
        }
        ClaimBusinessDto claimBusinessDto = new ClaimBusinessDto();

        claimBusinessDto.setUserId(claimBusinessVo.getUserId());
        claimBusinessDto.setInvitationCode(claimBusinessVo.getInvitationCode());
        claimBusinessDto.setBusinessId(claimBusinessVo.getBusinessId());
        RpcResponseVo rpcResponseVo = businessRestService.claimBusiness(claimBusinessDto);
        if (!rpcResponseVo.isSuccess()) {
            return ResultMapHelper.result(ResultCode.CODE_ERROR_100,rpcResponseVo.getMsg());
            //保存一条这边的记录
        }
        claimBusinessDto = rpcResponseVo.parseObject(ClaimBusinessDto.class);
        //选择一个默认店铺
        dataBankBusinessService.chooseDefaultBusiness(claimBusinessVo.getUserId(),claimBusinessVo.getBusinessId());
        return ResultMapHelper.success(null, ResultMsg.HAND_SUCCESS);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public Map<String, Object> doClaimBusiness_v3(ClaimBusinessVo claimBusinessVo) {
        DoClaimBusinessRpVo_v3 doClaimBusinessRpVo_v3 = new DoClaimBusinessRpVo_v3();
        Boolean flag = bmsDxClientRoleService.isDianyuanRole(claimBusinessVo.getUserId());
        if(flag){
            return ResultMapHelper.failure("对不起，你没有资格认领店铺");
        }
        //判断该店铺是否被认领
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq(DxshAppUserChannel.BUSINESS_ID,claimBusinessVo.getBusinessId());
        List<DxshAppUserChannel> dxshAppUserChannels = dxshAppUserChannelMapper.selectList(queryWrapper);
        if(CollectionUtils.isNotEmpty(dxshAppUserChannels)){
            return ResultMapHelper.result(ResultCode.CODE_ERROR_100,"该店铺已被认领,请联系管理人员协商");
        }

        DxshAppUserChannel dxshAppUserChannel = dxshAppUserChannelMapper.selectById(claimBusinessVo.getChannelId());
        if(dxshAppUserChannel == null){
            return ResultMapHelper.result(ResultCode.CODE_ERROR_100, ResultMsg.MSG_CLAIM_FAIL);
        }
        if(dxshAppUserChannel.getBusinessId() != null
                && dxshAppUserChannel.getIsClaimShop() == Constants.COMMON_FLAG_TRUE_INT){
            return ResultMapHelper.result(ResultCode.CODE_ERROR_100, ResultMsg.MSG_ALREADY_CLAIM);
        }
        //开始认领店铺
        ClaimBusinessDto claimBusinessDto = new ClaimBusinessDto();
        claimBusinessDto.setUserId(claimBusinessVo.getUserId());
        claimBusinessDto.setInvitationCode(claimBusinessVo.getInvitationCode());
        claimBusinessDto.setBusinessId(claimBusinessVo.getBusinessId());
        if(dxshAppUserChannel.getBusinessAuthId() != null){
            claimBusinessDto.setBusinessAuthId(dxshAppUserChannel.getBusinessAuthId());
        }
        RpcResponseVo rpcResponseVo = businessRestService.claimBusiness_v2(claimBusinessDto);
        if (!rpcResponseVo.isSuccess()) {
            return ResultMapHelper.result(ResultCode.CODE_ERROR_100,rpcResponseVo.getMsg());
            //保存一条这边的记录
        }
        claimBusinessDto = rpcResponseVo.parseObject(ClaimBusinessDto.class);
        dxshAppUserChannel.setBusinessId(claimBusinessVo.getBusinessId());
        dxshAppUserChannel.setChannelStatus(Constants.MDD_ALREAD_CLAIM_BUSINESS);
        dxshAppUserChannel.setIsClaimShop(Constants.COMMON_FLAG_TRUE_INT);
        dxshAppUserChannelMapper.updateById(dxshAppUserChannel);
        //选择一个默认店铺
        dataBankBusinessService.chooseDefaultBusiness(claimBusinessVo.getUserId(),claimBusinessVo.getBusinessId());
        doClaimBusinessRpVo_v3.setBusinessId(claimBusinessDto.getBusinessId());
        return ResultMapHelper.success(doClaimBusinessRpVo_v3, ResultMsg.HAND_SUCCESS);
    }

    /*@Override
    @Transactional(rollbackFor = Exception.class)
    public Map<String, Object> certificationBusiness(CertificationBusinessVo certificationBusinessVo) {
        CertificationBusinessDto certificationBusinessDto = BeanUtils.copyProperties(certificationBusinessVo,CertificationBusinessDto.class);
        RpcResponseVo rpcResponseVo = null;
        DxshAppMinappAuth dxshAppMinappAuth = null;
        if(certificationBusinessDto.getChannel() == DxshAppUserChannelService.CHANNEL_MINAPP){
            QueryWrapper queryWrapper = new QueryWrapper();
            queryWrapper.eq(DxshAppMinappAuth.USER_ID,certificationBusinessDto.getUserId());
            queryWrapper.eq(DxshAppMinappAuth.BUSINESS_ID,certificationBusinessDto.getBusinessId());
             dxshAppMinappAuth = dxshAppMinappAuthService.getOne(queryWrapper);
            if(dxshAppMinappAuth == null) {
                dxshAppMinappAuth = dxshAppMinappAuthService.createAuth(certificationBusinessDto.getUserId(), certificationBusinessDto.getBusinessId(), null);
            }
            rpcResponseVo = dxshAppMinappAuthService.certificationBusiness(certificationBusinessDto,dxshAppMinappAuth);
        }
        if(certificationBusinessDto.getChannel() == DxshAppUserChannelService.CHANNEL_MDD){
            rpcResponseVo = businessRestService.certificationBusiness(certificationBusinessDto);
        }
        if(rpcResponseVo.isSuccess()){
            //添加一条渠道
            certificationBusinessDto = rpcResponseVo.parseObject(CertificationBusinessDto.class);
            DxshAppUserChannel dxshAppUserChannel = this.addUserChannel(certificationBusinessVo.getUserId(),certificationBusinessVo.getBusinessId(),
                    certificationBusinessVo.getChannel(),certificationBusinessDto.getBusinessAuthId());
            if(certificationBusinessDto.getChannel() == DxshAppUserChannelService.CHANNEL_MINAPP) {
                if(dxshAppUserChannel != null){
                    dxshAppMinappAuth.setChannelId(dxshAppUserChannel.getId());
                    dxshAppMinappAuthService.saveOrUpdate(dxshAppMinappAuth);
                    dxshAppUserChannel.setBusinessAuthId(dxshAppMinappAuth.getId());

                    if(dxshAppUserChannel.getIsFill() == Constants.COMMON_FLAG_TRUE_INT){
                        //修改资质异常调用小程序接口
                        boolean flag = modifyQualificationInfo(dxshAppUserChannel,dxshAppMinappAuth);
                        if(!flag){
                            throw new SystemErrorException("小程序修改资质失败");
                        }
                    }

                }
            }
            pushChannelBankInfo(dxshAppUserChannel,certificationBusinessDto);
            pushIsFinish(dxshAppUserChannel,certificationBusinessDto);
            this.updateById(dxshAppUserChannel);
            return ResultMapHelper.success(null,ResultMsg.HAND_SUCCESS);
        }
        return ResultMapHelper.result(ResultCode.CODE_ERROR_100,rpcResponseVo.getMsg());
    }
*/
    @Transactional(rollbackFor = Exception.class)
    public Map<String, Object> certificationBusiness(CertificationBusinessVo certificationBusinessVo) {
        log.info("certificationBusinessVo:" + JSON.toJSONString(certificationBusinessVo));
        CertificationBusinessDto certificationBusinessDto = BeanUtils.copyProperties(certificationBusinessVo,CertificationBusinessDto.class);
        log.info("certificationBusinessDto:" + JSON.toJSONString(certificationBusinessDto));
        certificationBusinessDto.setIsMandatoryBusiness(true);
        RpcResponseVo rpcResponseVo = null;
        DxshAppMinappAuth dxshAppMinappAuth = null;
        if(certificationBusinessDto.getChannel() == DxshAppUserChannelService.CHANNEL_MINAPP){
            QueryWrapper queryWrapper = new QueryWrapper();
            queryWrapper.eq(DxshAppMinappAuth.USER_ID,certificationBusinessDto.getUserId());
            queryWrapper.eq(DxshAppMinappAuth.BUSINESS_ID,certificationBusinessDto.getBusinessId());
            dxshAppMinappAuth = dxshAppMinappAuthService.getOne(queryWrapper);
            if(dxshAppMinappAuth == null) {
                dxshAppMinappAuth = dxshAppMinappAuthService.createAuth(certificationBusinessDto.getUserId(), certificationBusinessDto.getBusinessId(), null);
            }
            rpcResponseVo = dxshAppMinappAuthService.certificationBusiness(certificationBusinessDto,dxshAppMinappAuth);
        }
        if(certificationBusinessDto.getChannel() == DxshAppUserChannelService.CHANNEL_MDD){
            rpcResponseVo = businessRestService.certificationBusiness(certificationBusinessDto);
        }
        if(rpcResponseVo.isSuccess()){
            //添加一条渠道
            certificationBusinessDto = rpcResponseVo.parseObject(CertificationBusinessDto.class);
            DxshAppUserChannel dxshAppUserChannel = this.addUserChannel(certificationBusinessVo.getUserId(),certificationBusinessVo.getBusinessId(),
                    certificationBusinessVo.getChannel(),certificationBusinessDto.getBusinessAuthId());
            if(certificationBusinessDto.getChannel() == DxshAppUserChannelService.CHANNEL_MINAPP) {
                if(dxshAppUserChannel != null){
                    dxshAppMinappAuth.setChannelId(dxshAppUserChannel.getId());
                    dxshAppMinappAuthService.saveOrUpdate(dxshAppMinappAuth);
                    dxshAppUserChannel.setBusinessAuthId(dxshAppMinappAuth.getId());

                    if(dxshAppUserChannel.getIsFill() == Constants.COMMON_FLAG_TRUE_INT){
                        //修改资质异常调用小程序接口
                        boolean flag = modifyQualificationInfo(dxshAppUserChannel,dxshAppMinappAuth);
                        if(!flag){
                            throw new SystemErrorException("小程序修改资质失败");
                        }
                    }

                }
            }
            pushChannelBankInfo(dxshAppUserChannel,certificationBusinessDto);
            log.info("--------------->资质是否完整  isFinish " + certificationBusinessDto.getIsFinished() +"<--------------" );
            pushIsFinish(dxshAppUserChannel,certificationBusinessDto);
            //dxshAppUserChannel.setIsFill(Constants.COMMON_FLAG_FALSE_INT);
            this.updateById(dxshAppUserChannel);
            return ResultMapHelper.success(null,ResultMsg.HAND_SUCCESS);
        }
        return ResultMapHelper.result(ResultCode.CODE_ERROR_100,rpcResponseVo.getMsg());
    }

    public void pushChannelBankInfo(DxshAppUserChannel dxshAppUserChannel,CertificationBusinessDto certificationBusinessDto){
        dxshAppUserChannel.setBankAccountType(certificationBusinessDto.getBankAccountType());
        dxshAppUserChannel.setOpenAccountName(certificationBusinessDto.getOpenAccountName());
        dxshAppUserChannel.setOpenBankName(certificationBusinessDto.getOpenBankName());
        dxshAppUserChannel.setSubBranchName(certificationBusinessDto.getSubBranchName());
        dxshAppUserChannel.setBankAccount(certificationBusinessDto.getBankAccount());

    }

    public void pushIsFinish(DxshAppUserChannel dxshAppUserChannel,CertificationBusinessDto certificationBusinessDto){
        dxshAppUserChannel.setIsFinish(certificationBusinessDto.getIsFinished());
    }

    public boolean modifyQualificationInfo(DxshAppUserChannel dxshAppUserChannel,DxshAppMinappAuth dxshAppMinappAuth){
        //先判断小程序是否完成创建流程
        if(dxshAppUserChannel.getIsFill() == Constants.COMMON_FLAG_TRUE_INT){
            Map<String,Object> map = new LinkedMap();
            map.put("appid",dxshAppUserChannel.getMinAppId());
            map.put("storeId",dxshAppUserChannel.getMinAppId());
            if(StringUtils.checkAnyNotNull(dxshAppMinappAuth.getLicenseName())){
                map.put("companyName",dxshAppMinappAuth.getLicenseName());
            }
            if(StringUtils.checkAnyNotNull(dxshAppMinappAuth.getLicenseNo())){
                map.put("companyCode",dxshAppMinappAuth.getLicenseNo());
            }
            if(StringUtils.checkAnyNotNull(dxshAppMinappAuth.getWechatAccount())){
                map.put("legalPersonaWechat",dxshAppMinappAuth.getWechatAccount());
            }
            if(StringUtils.checkAnyNotNull(dxshAppMinappAuth.getIdentityName())){
                map.put("legalPersonaName",dxshAppMinappAuth.getIdentityName());
            }
            if(StringUtils.checkAnyNotNull(dxshAppMinappAuth.getPhone())){
                map.put("componentPhone",dxshAppMinappAuth.getPhone());
            }
            if(StringUtils.checkAnyNotNull(dxshAppMinappAuth.getLicenseImg())){
                map.put("companyLicense",dxshAppMinappAuth.getLicenseImg());
            }

            //TODO:调用小程序接口修改小程序专属资料
            String token = RequestHeaderData.getRequestHeaderData().getString("token");
            String url = AppConfig.getProperty("saas.dxshapp.center.service") + "/dxshApp/app/updateEnterprise";
            RpcResponseVo rpcResponseVo = userRestService.getMiniTokenByUserId_v2(dxshAppUserChannel.getUserId(),token);
            if(rpcResponseVo.isSuccess()) {
                String minitoken = rpcResponseVo.getData().toString();
                String requestBody = RestTemplateUtils.postForEntityForJsonByLoadBalanced(url,map,RestTemplateUtils.getSassHeader(minitoken));
                JSONObject userJson = JSON.parseObject(requestBody);
                if(userJson.containsKey("status") && ResultCode.CODE_NORMAL.equals(userJson.getString("status"))){
                    return true;
                }
            }
        }
        return false;
    }

    public DxshAppUserChannel addUserChannel(Integer userId,Integer businessId,Integer channel,Integer bussinessAuthId){
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq(DxshAppUserChannel.USER_ID,userId);
        queryWrapper.eq(DxshAppUserChannel.BUSINESS_ID,businessId);
        queryWrapper.eq(DxshAppUserChannel.CHANNEL,channel);
        List<DxshAppUserChannel> userChannels = dxshAppUserChannelMapper.selectList(queryWrapper);
        if(!CollectionUtils.isNotEmpty(userChannels)){
            DxshAppUserChannel dxshAppUserChannel = new DxshAppUserChannel();
            dxshAppUserChannel.setUserId(userId);
            dxshAppUserChannel.setBusinessId(businessId);
            dxshAppUserChannel.setBusinessAuthId(bussinessAuthId);
            dxshAppUserChannel.setChannel(channel);
            dxshAppUserChannel.setNewTime(LocalDateTime.now());
            dxshAppUserChannel.setIsShow(Constants.COMMON_FLAG_FALSE_INT);
            dxshAppUserChannel.setIsFill(Constants.COMMON_FLAG_FALSE_INT);
            dxshAppUserChannelMapper.insert(dxshAppUserChannel);
            return dxshAppUserChannel;
        }else {
            DxshAppUserChannel dxshAppUserChannel = userChannels.get(0);
            dxshAppUserChannel.setBusinessAuthId(bussinessAuthId);
            dxshAppUserChannelMapper.updateById(dxshAppUserChannel);
        }
        return userChannels.get(0);
    }

    public DxshAppUserChannel mddAddUserChannel(Integer userId,Integer channel,Integer bussinessAuthId){
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq(DxshAppUserChannel.USER_ID,userId);
        queryWrapper.eq(DxshAppUserChannel.CHANNEL,channel);
        queryWrapper.eq(DxshAppUserChannel.BUSINESS_AUTH_ID,bussinessAuthId);
        List<DxshAppUserChannel> userChannels = dxshAppUserChannelMapper.selectList(queryWrapper);
        if(!CollectionUtils.isNotEmpty(userChannels)){
            DxshAppUserChannel dxshAppUserChannel = new DxshAppUserChannel();
            dxshAppUserChannel.setUserId(userId);
            dxshAppUserChannel.setBusinessAuthId(bussinessAuthId);
            dxshAppUserChannel.setChannel(channel);
            dxshAppUserChannel.setNewTime(LocalDateTime.now());
            dxshAppUserChannel.setIsShow(Constants.COMMON_FLAG_FALSE_INT);
            dxshAppUserChannelMapper.insert(dxshAppUserChannel);
            return dxshAppUserChannel;
        }else {
            DxshAppUserChannel dxshAppUserChannel = userChannels.get(0);
            dxshAppUserChannel.setBusinessAuthId(bussinessAuthId);
            dxshAppUserChannelMapper.updateById(dxshAppUserChannel);
        }
        return userChannels.get(0);
    }

    @Override
    public Map<String, Object> createAlipay(AddAlipayInfoVo addAlipayInfoVo) {
        List<DxshAppUserChannel> channels = findByUserIdAndBusinessIdAndChannel(addAlipayInfoVo.getUserId(), addAlipayInfoVo.getBusinessId(), DxshAppUserChannelService.CHANNEL_MDD);
        if(channels.size() == 0){
            return ResultMapHelper.failure("信息不存在");
        }
        DxshAppUserChannel dxshAppUserChannel = channels.get(0);
        RpcResponseVo rpcResponseVo = businessInfoRestService.addBusinessAlipayInfo(JSON.toJSONString(addAlipayInfoVo));
        if(rpcResponseVo.isSuccess()){
            AddAlipayInfoRpVo addAlipayInfoRpVo = BeanUtils.copyProperties(addAlipayInfoVo,AddAlipayInfoRpVo.class);
//            dxshAppUserChannel.setIsFill(Constants.COMMON_FLAG_TRUE_INT);
//            dxshAppUserChannelMapper.updateById(dxshAppUserChannel);
            dxshAppUserChannel.setIsSubmitMddInfo(Constants.COMMON_FLAG_TRUE_INT);
            dxshAppUserChannelMapper.updateById(dxshAppUserChannel);
            return ResultMapHelper.success(addAlipayInfoRpVo,ResultMsg.HAND_SUCCESS);
        }
        return ResultMapHelper.result(ResultCode.CODE_ERROR_100,rpcResponseVo.getMsg());
    }

    @Override
    public Map<String, Object> searchAlreadyBusiness(SearchAlreadyBusinessVo searchAlreadyBusinessVo) {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq(DxshAppUserChannel.USER_ID,searchAlreadyBusinessVo.getUserId());
        if(searchAlreadyBusinessVo.getIsSearchCert() == Constants.COMMON_FLAG_TRUE_INT){
            queryWrapper.eq(DxshAppUserChannel.IS_FILL,Constants.COMMON_FLAG_TRUE_INT);
        }
        List<DxshAppUserChannel> dxshAppUserChannels = dxshAppUserChannelMapper.selectList(queryWrapper);
        //过滤所有渠道都认证的店铺
        if(searchAlreadyBusinessVo.getIsSearchCert() == Constants.COMMON_FLAG_FALSE_INT){
            //查询的是可认领店铺
            postHandleFilterMultipleChannels(dxshAppUserChannels);
        }
        //过滤掉相同渠道且认领过的
        postHandleFilterSameChannel(dxshAppUserChannels,searchAlreadyBusinessVo.getChannel());

        Map<Integer,Integer> channelMap = new HashMap<>();
        Map<Integer,Integer> channelIdMap = new HashMap<>();
        dxshAppUserChannels.forEach(bu ->{
            channelMap.put(bu.getBusinessId(),bu.getIsFinish());
            channelIdMap.put(bu.getBusinessId(),bu.getId());

        });
        List<SearchAlreadyBusinessRpVo> searchAlreadyBusinessRpVos = new LinkedList<>();
        if(CollectionUtils.isNotEmpty(dxshAppUserChannels)){
            Set<Integer> businessIds = dxshAppUserChannels.stream().map(DxshAppUserChannel::getBusinessId).collect(Collectors.toSet());
            GetBusinessDataByIdsDto getBusinessDataByIdsDto = new GetBusinessDataByIdsDto();
            getBusinessDataByIdsDto.setBusinessIds(businessIds);
            RpcResponseVo rpcResponseVo = businessRestService.getBusinessByIds(getBusinessDataByIdsDto);
            if(rpcResponseVo.isSuccess()){
                getBusinessDataByIdsDto = rpcResponseVo.parseObject(GetBusinessDataByIdsDto.class);
                List<GetBusinessDataByIdDto> businessData = getBusinessDataByIdsDto.getBusinessData();
                if(CollectionUtils.isNotEmpty(businessData)){
                    for(GetBusinessDataByIdDto gu : businessData){
                        SearchAlreadyBusinessRpVo searchAlreadyBusinessRpVo = new SearchAlreadyBusinessRpVo();
                        BeanUtils.copyProperties(gu,searchAlreadyBusinessRpVo,BeanUtils.getNullPropertyNames(gu));
                        searchAlreadyBusinessRpVo.setBusinessId(gu.getId());
                        if(channelMap.containsKey(searchAlreadyBusinessRpVo.getBusinessId())){
                            searchAlreadyBusinessRpVo.setIsFinished(channelMap.get(searchAlreadyBusinessRpVo.getBusinessId()));
                            searchAlreadyBusinessRpVo.setChannelId(channelIdMap.get(searchAlreadyBusinessRpVo.getBusinessId()));
                        }
                        //searchAlreadyBusinessRpVo.setBusinessId(gu.getBmsBusinessId());
                        //searchAlreadyBusinessRpVo.setVendorName(gu.getBusinessRpDto().getVendorName());
                        searchAlreadyBusinessRpVos.add(searchAlreadyBusinessRpVo);
                    }
                }
            }
        }
        /*Integer userId = searchAlreadyBusinessVo.getUserId();
        RpcResponseVo rpcResponseVo = businessRestService.getUserClaimBusiness(userId,searchAlreadyBusinessVo.getIsSearchCert());
        if(rpcResponseVo.isSuccess()){
            List<GetUserClaimBusinessRpDto> getUserClaimBusinessRpDto = rpcResponseVo.parseArray(GetUserClaimBusinessRpDto.class);
            if(!(searchAlreadyBusinessVo.getIsSearchCert() == Constants.COMMON_FLAG_TRUE_INT)){
                //过滤所有渠道都认证的店铺
                postHandleFilterMultipleChannels(getUserClaimBusinessRpDto);
            }
            for(GetUserClaimBusinessRpDto gu : getUserClaimBusinessRpDto){
                SearchAlreadyBusinessRpVo searchAlreadyBusinessRpVo = new SearchAlreadyBusinessRpVo();
                BeanUtils.copyProperties(gu,searchAlreadyBusinessRpVo,BeanUtils.getNullPropertyNames(gu));
                //searchAlreadyBusinessRpVo.setBusinessId(gu.getBmsBusinessId());
                //searchAlreadyBusinessRpVo.setVendorName(gu.getBusinessRpDto().getVendorName());
                searchAlreadyBusinessRpVos.add(searchAlreadyBusinessRpVo);
            }
        }*/
        return ResultMapHelper.success(searchAlreadyBusinessRpVos,ResultMsg.MSG_GET_SUCCESS);
    }



    private void postHandleFilterSameChannel(List<DxshAppUserChannel> dxshAppUserChannels,Integer channel){
        if(CollectionUtils.isNotEmpty(dxshAppUserChannels)){
            Iterator<DxshAppUserChannel> iterator  = dxshAppUserChannels.iterator();
            while (iterator.hasNext()){
                DxshAppUserChannel go = iterator.next();
                if( go.getChannel() == channel){
                    iterator.remove();
                }
            }
        }

        System.out.println(dxshAppUserChannels);
    }

    private void postHandleFilterMultipleChannels(List<DxshAppUserChannel> dxshAppUserChannels) {
        if(CollectionUtils.isNotEmpty(dxshAppUserChannels)){
            Map<Integer,Integer> businessAlreadyUseMap = new HashMap<>();
            Set<Integer> businessIds = dxshAppUserChannels.stream().map(DxshAppUserChannel::getBusinessId).collect(Collectors.toSet());
            Map<String,Object> queryMap = new HashMap<>();
            Set<Integer> channels = new HashSet<>();
            channels.add(DxshAppUserChannelService.CHANNEL_MINAPP);
            channels.add(DxshAppUserChannelService.CHANNEL_MDD);
            queryMap.put("channels",StringUtils.join(channels,","));
            queryMap.put("num",channels.size());
            queryMap.put("businessIds",StringUtils.join(businessIds,","));
            List<DxshAppUserChannelBo> bos = dxshAppUserChannelMapper.selectMoreChannelUseBusiness(queryMap);
            Set<Integer> alreadyChannelUseBusiness = bos.stream().map(DxshAppUserChannelBo::getBusinessId).collect(Collectors.toSet());
            Iterator<DxshAppUserChannel> iterator  = dxshAppUserChannels.iterator();
            while (iterator.hasNext()){
                DxshAppUserChannel go = iterator.next();
                if(alreadyChannelUseBusiness.contains(go.getBusinessId())){
                    iterator.remove();
                }
            }
        }
        System.out.println(dxshAppUserChannels);
    }

    @Override
    public Map<String, Object> createBusiness(CreateBusinessVo createBusinessVo) {
        Boolean flag = bmsDxClientRoleService.isDianyuanRole(createBusinessVo.getUserId());
        if(flag){
            return ResultMapHelper.failure("对不起，你没有资格创建店铺");
        }
        CreateBusinessDto createBusinessDto = BeanUtils.copyProperties(createBusinessVo,CreateBusinessDto.class);
        //判断一下是否属于这个行业
        DxshAppIndustry dxshAppIndustry = dxshAppIndustryChooseService.getUserChooseInIndustry(createBusinessVo.getUserId());
        if(dxshAppIndustry != null){
            RpcResponseVo rpcResponseVo = businessTypeRestService.getBusinessTypeById(createBusinessDto.getTypeId());
            if(rpcResponseVo.isSuccess()){
                String typeName = rpcResponseVo.getDataElement("typeName").toString();
                if(BankBusinessController.industryTypeMap.containsKey(typeName)) {
                    if(!dxshAppIndustry.getIndustryName().equals(BankBusinessController.industryTypeMap.get(typeName))){
                        return ResultMapHelper.result(ResultCode.CODE_ERROR_100,"无法创建属于其他行业店铺类型的店铺");
                    }
                }
            }
        }
        RpcResponseVo rpcResponseVo = businessRestService.createBusiness(createBusinessDto);
        if(rpcResponseVo.isSuccess()){
            createBusinessDto = rpcResponseVo.parseObject(CreateBusinessDto.class);
            CreateBusinessRpVo createBusinessRpVo = BeanUtils.copyProperties(createBusinessDto,CreateBusinessRpVo.class);
            return ResultMapHelper.success(createBusinessRpVo,ResultMsg.HAND_SUCCESS);
        }
        return ResultMapHelper.result(rpcResponseVo.getStatus(),rpcResponseVo.getMsg());
    }

    @Override
    public Map<String, Object> getBusinessDataById(GetBusinessDataByIdVo getBusinessDataByIdVo) {
        Integer businessId = getBusinessDataByIdVo.getBusinessId();
        //查询行业
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq(DxshAppUserChannel.BUSINESS_ID,businessId);
        DxshAppUserChannel dxshAppUserChannel = dxshAppUserChannelMapper.selectOne(queryWrapper);
        dxshAppIndustryService.postHandleUserChannel(dxshAppUserChannel);
        if(dxshAppUserChannel == null){
            return ResultMapHelper.result(ResultCode.CODE_ERROR_100,"店铺不存在");
        }
        GetBusinessDataByIdDto getBusinessDataByIdDto = new GetBusinessDataByIdDto();
        getBusinessDataByIdDto.setBusinessId(businessId);
        RpcResponseVo rpcResponseVo = businessRestService.getBusinessById(getBusinessDataByIdDto);
        if(rpcResponseVo.isSuccess()){
            getBusinessDataByIdDto = rpcResponseVo.parseObject(GetBusinessDataByIdDto.class);
            GetBusinessDataByIdRpVo getBusinessDataByIdRpVo = BeanUtils.copyProperties(getBusinessDataByIdDto,GetBusinessDataByIdRpVo.class);
            //getBusinessDataByIdRpVo.setTypeName(getBusinessDataByIdDto.getTags());
            getBusinessDataByIdRpVo.setIndustryName(dxshAppUserChannel.getIndustryName());
            return ResultMapHelper.success(getBusinessDataByIdRpVo,ResultMsg.MSG_GET_SUCCESS);
        }
        return ResultMapHelper.result(ResultCode.CODE_ERROR_100,ResultMsg.HAND_FAIL);
    }

    @Override
    public Map<String, Object> minNameCheck(MinAppNameVo minAppNameVo) {
        String minName = minAppNameVo.getMinName();
        //TODO 调取鸿杰那边接口验证名称是否唯一
        return ResultMapHelper.result(null,ResultMsg.HAND_SUCCESS);
    }

//    @Override
//    public Map<String, Object> minSubmitInfo(MinExclusiveInfoVo minExclusiveInfoVo) {
//        Integer userId = minExclusiveInfoVo.getUserId();
//        Integer businessId = minExclusiveInfoVo.getBusinessId();
//        List<DxshAppUserChannel> channels = findByUserIdAndBusinessIdAndChannel(userId,businessId,DxshAppUserChannelService.CHANNEL_MINAPP);
//        if(channels.size()==0 || channels.size()>1){
//            return ResultMapHelper.failure("传入数据有误");
//        }
//        DxshAppUserChannel dxshAppUserChannel = channels.get(0);
//        BeanUtils.copyProperties(minExclusiveInfoVo,dxshAppUserChannel);
//        dxshAppUserChannelMapper.updateById(dxshAppUserChannel);
//
//
//        Map<String,Object> bigMap = new HashMap<>();
//        Map<String,Object> map1 = new HashMap<>();
//        map1.put("name",minExclusiveInfoVo.getMinName());
//        map1.put("logo",minExclusiveInfoVo.getMinHeadImg());
//        map1.put("intro",minExclusiveInfoVo.getMinIntroduce());
//        map1.put("demoId",minExclusiveInfoVo.getAppDemoId());
////        if(bmsBusinessType != null){
////            map1.put("appDemoId",bmsBusinessType.getId());
////            map1.put("industryId",bmsBusinessType.getId());
////        }
//
//        bigMap.put("wxAppData",map1);
//        Map<String,Object> map2 = new HashMap<>();
//
//        QueryWrapper queryWrapper = new QueryWrapper();
//        queryWrapper.eq(BmsBusiness.ID,minExclusiveInfoVo.getBusinessId());
//        queryWrapper.eq(BmsBusiness.IS_DELETE,Constants.COMMON_FLAG_FALSE_INT);
//        BmsBusiness bmsBusiness = bmsBusinessService.getOne(queryWrapper);
//        if(bmsBusiness == null){
//            return ResultMapHelper.failure("找不到店铺信息");
//        }
//        if(!BeanUtils.checkPropertiesNull(bmsBusiness,
//                "vendorName","addrProvince","addrCity","latitude",
//                "longitude","phone","businessHours")){
//            return ResultMapHelper.failure("店铺信息未完善，创建小程序失败");
//        }
//
//        map2.put("storeName",bmsBusiness.getVendorName());
//        map2.put("storeAddress",bmsBusiness.getAddrProvince()+bmsBusiness.getAddrCity()+bmsBusiness.getAddrDistrict()+bmsBusiness.getAddrDetails());
//        map2.put("storeLatitude",bmsBusiness.getLatitude());
//        map2.put("storeLongitude",bmsBusiness.getLongitude());
//        map2.put("contactPhone",bmsBusiness.getPhone());
//        map2.put("businessTime","08:00 ~ 11:00");
//        if(StringUtils.checkAnyNotNull(bmsBusiness.getStoreImg())){
//            map2.put("shopPicture",bmsBusiness.getStoreImg());
//        }
//        bigMap.put("branchStoreData",map2);
//
//
//        DxshAppMinappAuth dxshAppMinappAuth = dxshAppMinappAuthService.getOne(new QueryWrapper<DxshAppMinappAuth>().eq(DxshAppMinappAuth.CHANNEL_ID,dxshAppUserChannel.getId()));
//        if(dxshAppMinappAuth == null){
//            return ResultMapHelper.failure("找不到小程序店铺资质信息");
//        }
//        Map<String,Object> map3 = new HashMap<>();
//        map3.put("companyName",dxshAppMinappAuth.getLicenseName());
//        map3.put("companyCode",dxshAppMinappAuth.getLicenseNo());
////        map3.put("companyCodeType",dxshAppUserChannel.getCompanyCodeType());
//        map3.put("legalPersonaWechat",dxshAppMinappAuth.getWechatAccount());
//        map3.put("legalPersonaName",dxshAppMinappAuth.getIdentityName());
//        map3.put("componentPhone",dxshAppMinappAuth.getPhone());
//        map3.put("companyLicense",dxshAppMinappAuth.getLicenseImg());
//        map3.put("companyCertificates",minExclusiveInfoVo.getCompanyCertificates());
//        bigMap.put("appEnterpriseInfoData",map3);
//        System.out.println(JSON.toJSONString(bigMap));
//
//
//        //TODO 调取鸿杰那边的接口创建小程序
//        String url = AppConfig.getProperty("saas.dxshapp.center.service") + "/dxshApp/app/create";
//        String token = RequestHeaderData.getRequestHeaderData().getString("token");
//        RpcResponseVo minrpcResponseVo = userRestService.getMiniTokenByUserId_v2(minExclusiveInfoVo.getUserId(),token);
//        if(!minrpcResponseVo.isSuccess()){
//            return ResultMapHelper.failure(minrpcResponseVo.getMsg());
//        }
//        String minitoken = minrpcResponseVo.getData().toString();
//        String requestBody = RestTemplateUtils.postForEntityForJsonByLoadBalanced(url,bigMap,RestTemplateUtils.getSassHeader(minitoken));
//        JSONObject userJson = JSON.parseObject(requestBody);
//        if(userJson.containsKey("status")){
//            if(ResultCode.CODE_NORMAL.equals(userJson.getString("status"))){
//                dxshAppUserChannel.setStoreId(userJson.getString("data"));
//                dxshAppUserChannel.setMinAppId(userJson.getString("data"));
//                dxshAppUserChannel.setIsFill(Constants.COMMON_FLAG_TRUE_INT);
//                dxshAppUserChannel.setDemoId(minExclusiveInfoVo.getAppDemoId());
//                dxshAppUserChannelMapper.updateById(dxshAppUserChannel);
//                return ResultMapHelper.success(ResultMsg.HAND_SUCCESS);
//            }else{
//                if(userJson.getString("msg").startsWith("enterprise code invalid")){
//                    return ResultMapHelper.failure(ResultMsg.MSG_MIN_APP_CREATE_ERROR);
//                }
//                return ResultMapHelper.failure(userJson.getString("msg"));
//            }
//        }
//        return ResultMapHelper.failure(ResultMsg.HAND_FAIL);
//    }

    @Override
    public Map<String, Object> minSubmitInfo_v2(MinExclusiveInfoVo_v2 minExclusiveInfoVo) {
        Integer channelId = minExclusiveInfoVo.getChannelId();
        DxshAppUserChannel dxshAppUserChannel = dxshAppUserChannelMapper.selectById(minExclusiveInfoVo.getChannelId());
        if(dxshAppUserChannel == null){
            return ResultMapHelper.result(ResultCode.CODE_ERROR_100,ResultMsg.MSG_MIN_APP_CREATE_FAIL);
        }
        DxshAppMinappAuth dxshAppMinappAuth = dxshAppMinappAuthService.getMinAppAuthByChannelId(channelId);
        if(dxshAppMinappAuth == null){
            return ResultMapHelper.result(ResultCode.CODE_ERROR_100,ResultMsg.MSG_MIN_APP_CREATE_FAIL);
        }
        dxshAppMinappAuth.setMinName(minExclusiveInfoVo.getMinName());
        dxshAppMinappAuth.setMinHeadImg(minExclusiveInfoVo.getMinHeadImg());
        dxshAppMinappAuth.setMinIntroduce(minExclusiveInfoVo.getMinIntroduce());
        dxshAppMinappAuth.setCompanyCertificates(JSON.toJSONString(minExclusiveInfoVo.getCompanyCertificates()));
        dxshAppMinappAuthService.updateById(dxshAppMinappAuth);
        //小程序二段提交逻辑
        Map<String,Object> retMap = this.releaseWxApp(dxshAppUserChannel,dxshAppMinappAuth);
        dxshAppUserChannel.setMinappBaseInfoStatus(Constants.COMMON_FLAG_FALSE_INT);
        dxshAppUserChannelMapper.updateById(dxshAppUserChannel);
        Map<String,Object> resultMap = new HashMap<>();
        ApplicationContextHolder.getApplicationContext().publishEvent(new MinAppUserChannelRecordEvent(
                "record",dxshAppUserChannel.getUserId(),"提交了小程序的基础信息",dxshAppUserChannel.getId()));
        return ResultMapHelper.success(resultMap,ResultMsg.HAND_SUCCESS);
    }

    private Map<String,Object> releaseWxApp(DxshAppUserChannel dxshAppUserChannel, DxshAppMinappAuth dxshAppMinappAuth) {
        Map<String,Object> paramsMap = new HashMap<>();
        paramsMap.put("storeId",dxshAppUserChannel.getStoreId());
        paramsMap.put("name",dxshAppMinappAuth.getMinName());
        paramsMap.put("logo",dxshAppMinappAuth.getMinHeadImg());
        paramsMap.put("intro",dxshAppMinappAuth.getMinIntroduce());
        paramsMap.put("categoryCertificates",JSON.toJSONString(new HashMap<>()));
        DxshAppIndustryChild dxshAppIndustryChild = dxshAppIndustryChildService.getById(dxshAppUserChannel.getChooseMinIndustryId());
        List<String> quals = new ArrayList<>();
        if(StringUtils.isNotBlank(dxshAppMinappAuth.getCompanyCertificates())){
            quals.addAll(JSON.parseArray(dxshAppMinappAuth.getCompanyCertificates(),String.class));
        }
        if(dxshAppIndustryChild != null){
            String qualRequirements = dxshAppIndustryChild.getQualRequirements();
            if(StringUtils.isNotBlank(qualRequirements)){
                List<Map> maps = JSON.parseArray(qualRequirements,Map.class);
                if(CollectionUtils.isNotEmpty(maps)){
                    for(int ii = 0 ;ii < maps.size();ii++){
                        if(ii >= quals.size()) {
                            break;
                        }
                        maps.get(ii).put("value", quals.get(ii));
                    }
                }
                paramsMap.put("categoryCertificates",JSON.toJSONString(maps));
            }
        }
        try {
            //TODO 调取鸿杰那边的接口创建小程序
            String url = AppConfig.getProperty("saas.dxshapp.center.service") + "/dxshApp/app/release";
            String token = RequestHeaderData.getRequestHeaderData().getString("token");
            RpcResponseVo minrpcResponseVo = userRestService.getMiniTokenByUserId_v2(dxshAppUserChannel.getUserId(),
                    token);
            if(!minrpcResponseVo.isSuccess()){
                log.info("获取小程序调用token失败：{}");
                return ResultMapHelper.failure(minrpcResponseVo.getMsg());
            }
            String minitoken = minrpcResponseVo.getData().toString();
            String requestBody = RestTemplateUtils.postForEntityForJsonByLoadBalanced(url,paramsMap,RestTemplateUtils.getSassHeader(minitoken));
            JSONObject userJson = JSON.parseObject(requestBody);
            if(userJson.containsKey("status")){
                if(ResultCode.CODE_NORMAL.equals(userJson.getString("status"))){
                    return ResultMapHelper.success(ResultMsg.HAND_SUCCESS);
                }else{
                    if(userJson.getString("msg").startsWith("enterprise code invalid")){
                        return ResultMapHelper.failure(ResultMsg.MSG_MIN_APP_CREATE_ERROR);
                    }
                    return ResultMapHelper.failure(userJson.getString("msg"));
                }
            }
        }catch (Exception e){
            log.error(e.getMessage(),e);
        }
        return ResultMapHelper.failure(ResultMsg.HAND_FAIL);
    }

    @Override
    public Map<String, Object> minAppCollectionInfo(MinExclusiveInfoVo minExclusiveInfoVo) {
        Integer channelId = minExclusiveInfoVo.getChannelId();
        DxshAppMinappAuth dxshAppMinappAuth = dxshAppMinappAuthService.getMinAppAuthByChannelId(channelId);
        if(dxshAppMinappAuth == null){
            return ResultMapHelper.result(ResultCode.CODE_ERROR_100,ResultMsg.MSG_MIN_APP_CREATE_FAIL);
        }
        DxshAppUserChannel dxshAppUserChannel = dxshAppUserChannelMapper.selectById(channelId);
        if(dxshAppUserChannel == null){
            return ResultMapHelper.result(ResultCode.CODE_ERROR_100,ResultMsg.MSG_MIN_APP_CREATE_FAIL);
        }
        BeanUtils.copyProperties(minExclusiveInfoVo,dxshAppUserChannel,BeanUtils.getNullPropertyNames(minExclusiveInfoVo));
        BeanUtils.copyProperties(minExclusiveInfoVo,dxshAppMinappAuth,BeanUtils.getNullPropertyNames(minExclusiveInfoVo));
        dxshAppUserChannel.setCollectionInfoStatus(Constants.COMMON_FLAG_FALSE_INT);
        dxshAppMinappAuthService.updateById(dxshAppMinappAuth);
        dxshAppUserChannelMapper.updateById(dxshAppUserChannel);
//        if(minExclusiveInfoVo.getIsSubmitNow() == Constants.COMMON_FLAG_TRUE_INT){
//            this.createMinApp(channelId);
//        }
        ApplicationContextHolder.getApplicationContext().publishEvent(new MinAppUserChannelRecordEvent(
                "record",dxshAppUserChannel.getUserId(),"提交了小程序的收款信息",dxshAppUserChannel.getId()));
        return ResultMapHelper.success(new HashMap<>(),ResultMsg.HAND_SUCCESS);
    }

    @Override
    @GlobalTransactional(rollbackFor = Exception.class)
    public Map<String, Object> releaseMinApp(MinExclusiveInfoVo minExclusiveInfoVo) {
        //开始发布小程序
        Integer channelId = minExclusiveInfoVo.getChannelId();
        DxshAppUserChannel dxshAppUserChannel = dxshAppUserChannelMapper.selectById(channelId);
        if(dxshAppUserChannel == null){
            return ResultMapHelper.result(ResultCode.CODE_ERROR_100,ResultMsg.MSG_MIN_APP_CREATE_FAIL);
        }
        //检测三步是否成功
        if(!(dxshAppUserChannel.getMinappBaseInfoStatus().equals(Constants.COMMON_FLAG_TRUE_INT) &&
        dxshAppUserChannel.getMinappManInfoStatus().equals(Constants.COMMON_FLAG_TRUE_INT)) ){
            return ResultMapHelper.result(ResultCode.CODE_ERROR_100,ResultMsg.MSG_MIN_APP_IM_RE_INFO);
        }
        if(dxshAppUserChannel.getCollectionInfoStatus() != Constants.COMMON_SECOND
                && dxshAppUserChannel.getCollectionInfoStatus() != Constants.COMMON_FLAG_TRUE_INT){
            return ResultMapHelper.result(ResultCode.CODE_ERROR_100,ResultMsg.MSG_MIN_APP_IM_RE_INFO);
        }
        dxshAppUserChannel.setMinAppStatus(Constants.MINAPP_FRONT_STATUS_RELEASE_ING);
        dxshAppUserChannelMapper.updateById(dxshAppUserChannel);

        //进行小程序的发布

        return ResultMapHelper.success(new HashMap<>(),ResultMsg.HAND_SUCCESS);
    }

    @Override
    public Map<String, Object> getMinAppInfo(MinAppInfoVo minAppInfoVo) {
        List<DxshAppUserChannel> channels = findByUserIdAndBusinessIdAndChannel(minAppInfoVo.getUserId(), minAppInfoVo.getBusinessId(), DxshAppUserChannelService.CHANNEL_MINAPP);
        if(channels.size() == 0){
            return ResultMapHelper.failure("信息不存在");
        }
        DxshAppUserChannel dxshAppUserChannel = channels.get(0);
        Set<String> minAppIds = new HashSet<>();
        minAppIds.add(dxshAppUserChannel.getMinAppId());

        //TODO 调取鸿杰那边的接口获取小程序列表
        String url = AppConfig.getProperty("saas.dxshapp.center.service") + "/dxshApp/app/getByStoreIds";;
        String token = RequestHeaderData.getRequestHeaderData().getString("token");
        RpcResponseVo rpcResponseVo = userRestService.getMiniTokenByUserId_v2(minAppInfoVo.getUserId(),token);
        if(!rpcResponseVo.isSuccess()){
            return ResultMapHelper.failure(rpcResponseVo.getMsg());
        }
        String minitoken = rpcResponseVo.getData().toString();
        String requestBody = RestTemplateUtils.postForEntityForJsonByLoadBalanced(url,minAppIds,RestTemplateUtils.getSassHeader(minitoken));
        JSONObject userJson = JSON.parseObject(requestBody);
        GetMinAppInfoRpVo getMinAppInfoRpVo = new GetMinAppInfoRpVo();
        if(userJson.containsKey("status") && ResultCode.CODE_NORMAL.equals(userJson.getString("status"))){
            JSONObject result =  (JSONObject) userJson.get("data");
            if (result != null && result.containsKey(dxshAppUserChannel.getMinAppId())) {
                MinAppDto minAppDto = JSON.parseObject(result.getString(dxshAppUserChannel.getMinAppId()),MinAppDto.class);
                BeanUtils.copyProperties(minAppDto,getMinAppInfoRpVo,BeanUtils.getNullPropertyNames(minAppDto));
                getMinAppInfoRpVo.setBusinessId(dxshAppUserChannel.getBusinessId());
                getMinAppInfoRpVo.setAppName(minAppDto.getName());
                getMinAppInfoRpVo.setAppFace(minAppDto.getLogo());
                getMinAppInfoRpVo.setAppInfo(minAppDto.getIntro());
                getMinAppInfoRpVo.setAppDemoId(minAppDto.getDemoId().toString());
                return ResultMapHelper.success(getMinAppInfoRpVo,ResultMsg.MSG_GET_SUCCESS);
            }
        }
        return ResultMapHelper.success(getMinAppInfoRpVo,ResultMsg.MSG_GET_SUCCESS);
    }





    @Override
    @Transactional
    public Map<String, Object> editMinAppInfo(MinExclusiveInfoVo minExclusiveInfoVo) {
        List<DxshAppUserChannel> channels = findByUserIdAndBusinessIdAndChannel(minExclusiveInfoVo.getUserId(), minExclusiveInfoVo.getBusinessId(), DxshAppUserChannelService.CHANNEL_MINAPP);
        if(channels.size()==0){
            return ResultMapHelper.failure("信息不存在");
        }
        DxshAppUserChannel dxshAppUserChannel = channels.get(0);
//        BeanUtils.copyProperties(minExclusiveInfoVo,dxshAppUserChannel);
//        dxshAppUserChannelMapper.updateById(dxshAppUserChannel);

        //TODO:调用小程序接口修改小程序专属资料
        String url = AppConfig.getProperty("saas.dxshapp.center.service") + "/dxshApp/app/updateAppInfo";
        String zizhiUrl = AppConfig.getProperty("saas.dxshapp.center.service") + "/dxshApp/app/updateEnterprise";
        String token = RequestHeaderData.getRequestHeaderData().getString("token");
        RpcResponseVo rpcResponseVo = userRestService.getMiniTokenByUserId_v2(minExclusiveInfoVo.getUserId(),token);
        if(!rpcResponseVo.isSuccess()){
            return ResultMapHelper.failure(rpcResponseVo.getMsg());
        }
        String minitoken = rpcResponseVo.getData().toString();
        EditMinAppInfoDto editMinAppInfoDto = new EditMinAppInfoDto();
        editMinAppInfoDto.setId(dxshAppUserChannel.getMinAppId());
        editMinAppInfoDto.setName(minExclusiveInfoVo.getMinName());
        editMinAppInfoDto.setLogo(minExclusiveInfoVo.getMinHeadImg());
        editMinAppInfoDto.setIntro(minExclusiveInfoVo.getMinIntroduce());
        editMinAppInfoDto.setDemoId(minExclusiveInfoVo.getAppDemoId());
        editMinAppInfoDto.setAppid(dxshAppUserChannel.getMinAppId());
        editMinAppInfoDto.setStoreId(dxshAppUserChannel.getStoreId());
        editMinAppInfoDto.setCompanyCertificates(minExclusiveInfoVo.getCompanyCertificates());
        String requestBody = RestTemplateUtils.postForEntityForJsonByLoadBalanced(url,editMinAppInfoDto,RestTemplateUtils.getSassHeader(minitoken));
        String requestBody2 = RestTemplateUtils.postForEntityForJsonByLoadBalanced(zizhiUrl,editMinAppInfoDto,RestTemplateUtils.getSassHeader(minitoken));
        JSONObject userJson = JSON.parseObject(requestBody);
        JSONObject userJson2 = JSON.parseObject(requestBody2);
        if(userJson.containsKey("status") && ResultCode.CODE_NORMAL.equals(userJson.getString("status"))){
            if(userJson2.containsKey("status") && ResultCode.CODE_NORMAL.equals(userJson.getString("status"))){
                return ResultMapHelper.success(null,ResultMsg.UPDATE_SUCCESS);
            }

        }
        return ResultMapHelper.result(null,ResultMsg.HAND_FAIL);
    }

    @Override
    public Map<String, Object> getMinAppList(BaseRqVo baseRqVo) {

        Integer businessRole = bmsDxClientRoleService.getRoleId(baseRqVo.getUserId());
        Page<DxshAppUserChannel> page = new Page<>(baseRqVo.getPageNum(),baseRqVo.getPageSize());

        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq(DxshAppUserChannel.USER_ID,baseRqVo.getUserId());
        queryWrapper.eq(DxshAppUserChannel.CHANNEL,CHANNEL_MINAPP);
//        queryWrapper.eq(DxshAppUserChannel.IS_FILL,Constants.COMMON_FLAG_TRUE_INT);
        queryWrapper.orderByDesc(DxshAppUserChannel.IS_FILL + "=1");
        queryWrapper.orderByAsc(DxshAppUserChannel.NEW_TIME);

        IPage<DxshAppUserChannel> dxshAppUserChannelIPage = dxshAppUserChannelMapper.selectPage(page,queryWrapper);
        Map<String,Object> userData = MybatisUtils.UserData(dxshAppUserChannelIPage);
        List<BannerRpVo> bannerRpVoList = dxshAppBannerService.bannerList(DxshAppBannerService.CHANNEL_MIN_TYPE);
        userData.put("banner",bannerRpVoList);
        List<DxshAppUserChannel> dxshAppUserChannelList = dxshAppUserChannelIPage.getRecords();
        Map<Integer,DxshAppUserChannel> dMap = new HashMap<>();
        if(dxshAppUserChannelList.size() > 0){
            dxshAppUserChannelList.forEach(du -> {
                dMap.put(du.getId(),du);
            });
            List<ChannelBo> channelBoList = BeanUtils.copyList(dxshAppUserChannelList,ChannelBo.class);
            Set<String> minAppIds = dxshAppUserChannelList.stream()
                    .filter(v->CHANNEL_MINAPP == v.getChannel() && v.getMinAppId()!=null)
                    .map(DxshAppUserChannel::getMinAppId).collect(Collectors.toSet());
            Iterator iterator = minAppIds.iterator();
            while(iterator.hasNext()){
                String minAppId = iterator.next().toString();
                if(!PatternMatchUtils.isNumeric(minAppId)){
                    iterator.remove();
                }
            }
            //TODO 调取鸿杰那边的接口获取小程序列表
            String token = RequestHeaderData.getRequestHeaderData().getString("token");
            String url = AppConfig.getProperty("saas.dxshapp.center.service") + "/dxshApp/app/getByStoreIds";;
            RpcResponseVo rpcResponseVo = userRestService.getMiniTokenByUserId_v2(baseRqVo.getUserId(),token);
            if(!rpcResponseVo.isSuccess()){
                return ResultMapHelper.failure(rpcResponseVo.getMsg());
            }
            String minitoken = rpcResponseVo.getData().toString();
            Set<Integer> dxshAppUserChannels = new HashSet<>();
            try {
                String requestBody = RestTemplateUtils.postForEntityForJsonByLoadBalanced(url,minAppIds,RestTemplateUtils.getSassHeader(minitoken));
                JSONObject userJson = JSON.parseObject(requestBody);
                if(userJson.containsKey("status") && ResultCode.CODE_NORMAL.equals(userJson.getString("status"))){
                    JSONObject result =  (JSONObject) userJson.get("data");
                    if (result != null) {
                        for(ChannelBo q:channelBoList){
                            if(q.getChannel()==CHANNEL_MINAPP && StringUtils.checkAnyNotNull(q.getMinAppId()) && result.containsKey(q.getMinAppId())){
                                MinAppDto minAppDto = JSON.parseObject(result.getString(q.getMinAppId()),MinAppDto.class);
                                q.setVendorName(minAppDto.getName());
                                q.setOrderNum(minAppDto.getAppOrderCountData().getTodayOrderQuantity());
                                q.setTurnover(minAppDto.getAppOrderCountData().getTodayOrderSum());
                                q.setAppStatus(minAppDto.getStatus());
                                if(q.getAppStatus() == Constants.MINAPP_STATUS_CREATE_FAIL){
                                    dxshAppUserChannels.add(q.getId());
                                }
                                q.setWxReleaseStatus(minAppDto.getWxReleaseStatus());
                                q.setWxReleaseStep(minAppDto.getWxReleaseStep());
                                q.setLoginUrl(minAppDto.getLogo());
                                if(q.getAppStatus() == Constants.MINAPP_STATUS_CREATE_ING){
                                    q.setAppStatus(Constants.MINAPP_STATUS_CREATE_SUCCESS);
                                }
                            }
                        }
                    }
                }
            }catch (Exception e){
                log.error(e.getMessage(),e);
            }
            channelBoList.forEach(bo->{
                dxshAppIndustryService.postHandleUserChannel(bo);
                bo.setBusinessRole(businessRole);
            });
            List<ChannelRpVo> channelRpVoList = BeanUtils.copyList(channelBoList,ChannelRpVo.class);
            postUpdateMinAppStatus(dxshAppUserChannels,dMap);
            return ResultMapHelper.success(channelRpVoList,userData,ResultMsg.MSG_GET_SUCCESS);

        }


        return ResultMapHelper.success(dxshAppUserChannelList,userData,ResultMsg.MSG_GET_SUCCESS);
    }

    @Override
    public Map<String, Object> updateBusinessData(UpdateBusinessDataVo updateBusinessDataVo) {
        UpdateBusinessDto updateBusinessDto = new UpdateBusinessDto();
        BeanUtils.copyProperties(updateBusinessDataVo,updateBusinessDto);
        RpcResponseVo rpcResponseVo = businessRestService.updateBusiness(updateBusinessDto);
        if(rpcResponseVo.isSuccess()){
            updateBusinessDto = rpcResponseVo.parseObject(UpdateBusinessDto.class);
            UpdateBusinessDataRpVo updateBusinessDataRpVo = BeanUtils.copyProperties(updateBusinessDto,UpdateBusinessDataRpVo.class);
            Map<String,Object> resultMap = new HashMap<>();
            resultMap.put("business",updateBusinessDataRpVo);
            return ResultMapHelper.success(resultMap,ResultMsg.HAND_SUCCESS);
        }
        return ResultMapHelper.result(ResultCode.CODE_ERROR_100,rpcResponseVo.getMsg());
    }

    @Override
    public Map<String, Object> cardToBank(CardInfoVo cardInfoVo) {
        CardInfoRpVo cardInfoRpVo = new CardInfoRpVo();
        try{
            String jsonCode = IOUtils.toString(new InputStreamReader(resource.getInputStream(),"UTF-8"));
            Map<String, String> bankCode = (Map)JSON.parse(jsonCode);
            Map<String,Object> params = new HashMap<>();
            params.put("cardNo",cardInfoVo.getCardNum());
            params.put("_input_charset","utf-8");
            params.put("cardBinCheck","true");
            String sendUrl = "https://ccdcapi.alipay.com/validateAndCacheCardInfo.json";
            String forEntity = RestTemplateUtils.getForEntity(sendUrl, params);
            Map<String,Object> resultMap = (Map)JSON.parse(forEntity);
            if(StringUtils.equals(resultMap.get("stat").toString(),"ok")&&Boolean.parseBoolean(resultMap.get("validated").toString())){
                String cardType = bankCode.get(resultMap.get("bank"));
                cardInfoRpVo.setBankName(cardType);
            }
        }catch (Exception e){
            log.error(e.getMessage(),e);
        }
        return ResultMapHelper.success(cardInfoRpVo,ResultMsg.HAND_SUCCESS);
    }

    @Override
    public Map<String,Object> getBankByCity(CityCodeVo cityCodeVo) {
        List<BankBranchRpVo> bankBranch = pcBankDataService.getBankBranch(cityCodeVo);
        return ResultMapHelper.success(bankBranch,ResultMsg.HAND_SUCCESS);
    }

    @Override
    public Map<String, Object> getQuickAccessList(BaseRqVo baseRqVo) {
        Integer businessRole = bmsDxClientRoleService.getRoleId(baseRqVo.getUserId());
        if(businessRole == Constants.MDD_DY_ROLE_ID){
            return ResultMapHelper.success(null,"店员不可设置快捷访问功能");
        }
        //TODO:快捷访问设置
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq(DxshAppUserChannel.USER_ID,baseRqVo.getUserId());
        queryWrapper.eq(DxshAppUserChannel.IS_FILL,Constants.COMMON_FLAG_TRUE_INT);
        queryWrapper.orderByDesc(DxshAppUserChannel.NEW_TIME);
        List<DxshAppUserChannel> dxshAppUserChannelList = dxshAppUserChannelMapper.selectList(queryWrapper);
        if(dxshAppUserChannelList.size() > 0){
            List<QuickAccessBo> quickAccessBoList = BeanUtils.copyList(dxshAppUserChannelList,QuickAccessBo.class);
            GetMddBusinessDataByDxshAppDto getMddBusinessDataByDxshAppDto = new GetMddBusinessDataByDxshAppDto();

            Set<Integer> businessIds = quickAccessBoList.stream()
                    .filter(v->CHANNEL_MDD == v.getChannel()  && v.getBusinessId()!=null)
                    .map(DxshAppUserChannel::getBusinessId).collect(Collectors.toSet());

            getMddBusinessDataByDxshAppDto.setBusinessIds(businessIds);
            RpcResponseVo rpcResponseVo = businessRestService.getMddBusinessDataByDxshApp(getMddBusinessDataByDxshAppDto);
            if(rpcResponseVo.isSuccess()){
                getMddBusinessDataByDxshAppDto = rpcResponseVo.parseObject(GetMddBusinessDataByDxshAppDto.class);
                for(QuickAccessBo q:quickAccessBoList){
                    for(GetMddBusinessDataByDxshAppDto.BusinessDataDto dto:getMddBusinessDataByDxshAppDto.getBusinessDatas()){
                        if( q.getChannel()==CHANNEL_MDD && q.getBusinessId().equals( dto.getBusinessId()) ){
                            q.setVendorName(dto.getVendorName());
                            q.setLoginUrl(dto.getLoginUrl());
                            q.setGroupBuyNum(dto.getGroupBuyNum());
                            q.setVerNum(dto.getVerNum());
                        }
                    }
                }

            }
            //获取小程序的
            Set<String> minAppIds = quickAccessBoList.stream()
                    .filter(v->CHANNEL_MINAPP == v.getChannel() && v.getMinAppId() != null && v.getIsFill() == Constants.COMMON_FLAG_TRUE_INT)
                    .map(DxshAppUserChannel::getMinAppId).collect(Collectors.toSet());
            String token = RequestHeaderData.getRequestHeaderData().getString("token");
            String url = AppConfig.getProperty("saas.dxshapp.center.service") + "/dxshApp/app/getByStoreIds";;
            RpcResponseVo minrpcResponseVo = userRestService.getMiniTokenByUserId_v2(baseRqVo.getUserId(),token);
            if(minrpcResponseVo.isSuccess()){
                String minitoken = minrpcResponseVo.getData().toString();
                String requestBody = RestTemplateUtils.postForEntityForJsonByLoadBalanced(url,minAppIds,RestTemplateUtils.getSassHeader(minitoken));
                JSONObject userJson = JSON.parseObject(requestBody);
                if(userJson.containsKey("status") && ResultCode.CODE_NORMAL.equals(userJson.getString("status"))){
                    JSONObject result =  (JSONObject) userJson.get("data");
                    if(result != null){
                        Iterator<QuickAccessBo> it = quickAccessBoList.iterator();
                        while(((Iterator)it).hasNext()){
                            QuickAccessBo q = it.next();
                            if(q.getChannel()==CHANNEL_MINAPP && StringUtils.checkAnyNotNull(q.getMinAppId()) && result.containsKey(q.getMinAppId())){
                                MinAppDto minAppDto = JSON.parseObject(result.getString(q.getMinAppId()),MinAppDto.class);

                                q.setVendorName(minAppDto.getName());
                                q.setLoginUrl(minAppDto.getLogo());
                                q.setOrderNum(minAppDto.getAppOrderCountData().getTodayOrderQuantity());
                                q.setTurnover(minAppDto.getAppOrderCountData().getTodayOrderSum());
                                if(minAppDto.getStatus() != 6){
                                    it.remove();
                                    log.info("已移除:"+q.getId());
                                }
                            }
                        }

                    }


                }
            }
            quickAccessBoList.forEach(bo->{
                List<BmsBusinessType> bmsBusinessTypes =bmsBusinessTypeService.getTypeByBusinessId(bo.getBusinessId());
                if(CollectionUtils.isNotEmpty(bmsBusinessTypes) && bmsBusinessTypes.size() > 0){
                    BmsBusinessType bmsBusinessType = bmsBusinessTypes.get(0);

                    bo.setIndustryName(bmsBusinessType.getTypeName());
                    bo.setBackColor(bmsBusinessType.getBackColor());
                    bo.setFontColor(bmsBusinessType.getFontColor());

                }
                bo.setBusinessRole(businessRole);
            });
            List<QuickAccessRpVo> quickAccessRpVoList = BeanUtils.copyList(quickAccessBoList,QuickAccessRpVo.class);
            return ResultMapHelper.success(quickAccessRpVoList,ResultMsg.MSG_GET_SUCCESS);
        }





        return ResultMapHelper.success(null,"暂无数据");
    }


    public List<DxshAppUserChannel> findByUserIdAndBusinessIdAndChannel(Integer userId,Integer businessId,Integer channel){
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq(DxshAppUserChannel.USER_ID, userId);
        queryWrapper.eq(DxshAppUserChannel.BUSINESS_ID, businessId);
        queryWrapper.eq(DxshAppUserChannel.CHANNEL,channel);
        return dxshAppUserChannelMapper.selectList(queryWrapper);
    }

    @Override
    public Map<String, Object> getCertificationBusiness(GetCertificationBusinessVo certificationBusinessVo) {
        DxshAppUserChannel dxshAppUserChannel = null;
        Integer businessId;
        Integer channel;
        if (certificationBusinessVo.getChannelId() != null) {
            QueryWrapper queryWrapper = new QueryWrapper();
            queryWrapper.eq(DxshAppUserChannel.ID,certificationBusinessVo.getChannelId());
            queryWrapper.eq(DxshAppUserChannel.USER_ID,certificationBusinessVo.getUserId());
            dxshAppUserChannel = dxshAppUserChannelMapper.selectOne(queryWrapper);
            if (dxshAppUserChannel == null) {
                return ResultMapHelper.result(ResultCode.CODE_ERROR_100, ResultMsg.MSG_CHANNEL_NO_ESIST);
            }
            businessId = dxshAppUserChannel.getBusinessId();
            channel = dxshAppUserChannel.getChannel();
        } else {
            if (certificationBusinessVo.getBusinessId() == null) {
                return ResultMapHelper.result(ResultCode.CODE_ERROR_100, ResultMsg.CODE_ERROR_03);
            }
            businessId = certificationBusinessVo.getBusinessId();
            channel = certificationBusinessVo.getChannel();
            dxshAppUserChannel = dxshAppUserChannelMapper.selectOne(new QueryWrapper<DxshAppUserChannel>()
                    .eq(DxshAppUserChannel.USER_ID,certificationBusinessVo.getUserId())
                    .eq(DxshAppUserChannel.BUSINESS_ID, businessId)
                    .eq(DxshAppUserChannel.CHANNEL,certificationBusinessVo.getChannel()));

        }
        //获取资质信息
        GetCertificationBusinessRpVo xcxrpVo = null;
        GetCertificationBusinessRpVo mddrpVo = null;

        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq(DxshAppMinappAuth.BUSINESS_ID, certificationBusinessVo.getBusinessId());

        DxshAppMinappAuth dxshAppMinappAuth = dxshAppMinappAuthService.getOne(queryWrapper);
        if (dxshAppMinappAuth != null) {
            xcxrpVo = new GetCertificationBusinessRpVo();

            if (dxshAppUserChannel != null && channel == DxshAppUserChannelService.CHANNEL_MINAPP) {
                BeanUtils.copyProperties(dxshAppUserChannel, xcxrpVo);
                dxshAppIndustryService.postHandleIsShowOther(dxshAppUserChannel,xcxrpVo);

            }
            BeanUtils.copyProperties(dxshAppMinappAuth, xcxrpVo);
        }


        RpcResponseVo rpcResponseVo = businessRestService.getBusinessAuthByBusinessId(businessId);
        if (rpcResponseVo.isSuccess()) {
            mddrpVo = new GetCertificationBusinessRpVo();
            if (dxshAppUserChannel != null && channel == DxshAppUserChannelService.CHANNEL_MDD) {
                BeanUtils.copyProperties(dxshAppUserChannel, mddrpVo);
//                dxshAppIndustryService.postHandleIsShowOther(dxshAppUserChannel,mddrpVo);

            }
            BusinessAuthDto businessAuthDto = rpcResponseVo.parseObject(BusinessAuthDto.class);
            BeanUtils.copyProperties(businessAuthDto, mddrpVo);
            mddrpVo.setBusinessId(businessAuthDto.getBmsBusinessId());
            if (businessAuthDto.getLicenseStartTime() != null) {
                mddrpVo.setLicenseStartTime(LocalDateTime.ofInstant(businessAuthDto.getLicenseStartTime().toInstant(), ZoneId.systemDefault()));
            }
            if (businessAuthDto.getLicenseExpired() != null) {
                mddrpVo.setLicenseExpired(LocalDateTime.ofInstant(businessAuthDto.getLicenseExpired().toInstant(), ZoneId.systemDefault()));
            }
            if (businessAuthDto.getIdentityStartTime() != null) {
                mddrpVo.setIdentityStartTime(LocalDateTime.ofInstant(businessAuthDto.getIdentityStartTime().toInstant(), ZoneId.systemDefault()));
            }
            if (businessAuthDto.getIdentityExpired() != null) {
                mddrpVo.setIdentityExpired(LocalDateTime.ofInstant(businessAuthDto.getIdentityExpired().toInstant(), ZoneId.systemDefault()));
            }


        }


        if (channel == DxshAppUserChannelService.CHANNEL_MINAPP) {
            if (xcxrpVo != null) {
                return ResultMapHelper.success(xcxrpVo, ResultMsg.MSG_GET_SUCCESS);
            } else if (mddrpVo != null) {
                return ResultMapHelper.success(mddrpVo, ResultMsg.MSG_GET_SUCCESS);
            }
        }
        if (channel== DxshAppUserChannelService.CHANNEL_MDD) {
            if (mddrpVo != null) {
                return ResultMapHelper.success(mddrpVo, ResultMsg.MSG_GET_SUCCESS);
            } else if (xcxrpVo != null) {
                return ResultMapHelper.success(xcxrpVo, ResultMsg.MSG_GET_SUCCESS);
            }
        }


        return ResultMapHelper.success(null, ResultMsg.MSG_GET_SUCCESS);
    }



    public Map<String, Object> getCertificationBusiness_v2(GetCertificationBusinessVo certificationBusinessVo) {
        DxshAppUserChannel dxshAppUserChannel = null;
        Integer businessId;
        Integer channel;
        //获取资质信息
        GetCertificationBusinessRpVo xcxrpVo = new GetCertificationBusinessRpVo();
        GetCertificationBusinessRpVo mddrpVo = new GetCertificationBusinessRpVo();
        if (certificationBusinessVo.getChannelId() != null) {
            QueryWrapper queryWrapper = new QueryWrapper();
            queryWrapper.eq(DxshAppUserChannel.ID,certificationBusinessVo.getChannelId());
            dxshAppUserChannel = dxshAppUserChannelMapper.selectOne(queryWrapper);
            if (dxshAppUserChannel == null) {
                return ResultMapHelper.result(ResultCode.CODE_ERROR_100, ResultMsg.MSG_CHANNEL_NO_ESIST);
            }
            if(dxshAppUserChannel.getChannel() == DxshAppUserChannelService.CHANNEL_MDD) {
                businessId = dxshAppUserChannel.getBusinessId();
                RpcResponseVo responseVo = businessRestService.getBusinessAuthByBusinessId(businessId);
                if (!responseVo.isSuccess()) {
                    return ResultMapHelper.result(ResultCode.CODE_ERROR_100, ResultMsg.HAND_FAIL);
                }
                BusinessAuthDto businessAuthDto = responseVo.parseObject(BusinessAuthDto.class);
                //查出店铺数据
                BeanUtils.copyProperties(businessAuthDto, mddrpVo);
                postHandleCerDataMdd(businessAuthDto,mddrpVo);
                return ResultMapHelper.success(mddrpVo, ResultMsg.MSG_GET_SUCCESS);
            }else if(dxshAppUserChannel.getChannel() == DxshAppUserChannelService.CHANNEL_MINAPP){
                //获取小程序资质
                Integer channedId = dxshAppUserChannel.getId();
                DxshAppMinappAuth dxshAppMinappAuth = dxshAppMinappAuthService.getMinAppAuthByChannelId(channedId);
                if(dxshAppMinappAuth == null){
                    //查询觅东东有没有资质
                    DxshAppUserChannel mddChannel = this.getMddChannelByUserId(certificationBusinessVo.getUserId());
                    if(mddChannel != null && mddChannel.getBusinessAuthId() != null){
                        Integer businessAuthId = mddChannel.getBusinessAuthId();
                        RpcResponseVo rpcResponseVo = businessAuthRestService.getUserClaimBusinessByBusinessAuthId(businessAuthId);
                        if(rpcResponseVo.isSuccess()){
                            List<GetUserClaimBusinessRpDto> getUserClaimBusinessRpDtos = rpcResponseVo.parseArray(GetUserClaimBusinessRpDto.class);
                            if(CollectionUtils.isNotEmpty(getUserClaimBusinessRpDtos)){
                                dxshAppMinappAuth = new DxshAppMinappAuth();
                                dxshAppMinappAuth.setLicenseType(getUserClaimBusinessRpDtos.get(0).getLicenseType());
                                dxshAppMinappAuth.setLicenseImg(getUserClaimBusinessRpDtos.get(0).getLicenseImg());
                                dxshAppMinappAuth.setLicenseNo(getUserClaimBusinessRpDtos.get(0).getLicenseNo());
                                dxshAppMinappAuth.setLicenseName(getUserClaimBusinessRpDtos.get(0).getLicenseName());
                                dxshAppMinappAuth.setLicenseStartTime(DateTimeUtils.converDateToLocalDateTime(getUserClaimBusinessRpDtos.get(0).getLicenseStartTime()));
                                dxshAppMinappAuth.setLicenseExpired(DateTimeUtils.converDateToLocalDateTime(getUserClaimBusinessRpDtos.get(0).getLicenseExpired()));
                                dxshAppMinappAuth.setIsExpired(getUserClaimBusinessRpDtos.get(0).getIsExpired());
                            }
                        }
                    }
                }
                if(dxshAppMinappAuth != null) {
                    BeanUtils.copyProperties(dxshAppMinappAuth, xcxrpVo);
                }
                return ResultMapHelper.success(xcxrpVo, ResultMsg.MSG_GET_SUCCESS);
            }
        } else {
            //没有channelId默认觅东东
            //
            businessId = dankMerchantsDefBusinessService.getChooseBusinessId(certificationBusinessVo.getUserId());
            if(businessId == null){
                return ResultMapHelper.success(mddrpVo, ResultMsg.MSG_GET_SUCCESS);
            }
            RpcResponseVo responseVo = businessRestService.getBusinessAuthByBusinessId(businessId);
            if(!responseVo.isSuccess()) {
                return ResultMapHelper.result(ResultCode.CODE_ERROR_100,ResultMsg.HAND_FAIL);
            }
            BusinessAuthDto businessAuthDto = responseVo.parseObject(BusinessAuthDto.class);
            //查出店铺数据
            BeanUtils.copyProperties(businessAuthDto, mddrpVo);
            postHandleCerDataMdd(businessAuthDto,mddrpVo);
            return ResultMapHelper.success(mddrpVo, ResultMsg.MSG_GET_SUCCESS);
        }


//        QueryWrapper queryWrapper = new QueryWrapper();
//        queryWrapper.eq(DxshAppMinappAuth.BUSINESS_ID, certificationBusinessVo.getBusinessId());
//
//        DxshAppMinappAuth dxshAppMinappAuth = dxshAppMinappAuthService.getOne(queryWrapper);
//        if (dxshAppMinappAuth != null) {
//            xcxrpVo = new GetCertificationBusinessRpVo();
//
//            if (dxshAppUserChannel != null && channel == DxshAppUserChannelService.CHANNEL_MINAPP) {
//                BeanUtils.copyProperties(dxshAppUserChannel, xcxrpVo);
//                dxshAppIndustryService.postHandleIsShowOther(dxshAppUserChannel,xcxrpVo);
//
//            }
//            BeanUtils.copyProperties(dxshAppMinappAuth, xcxrpVo);
//        }
//
//
//        RpcResponseVo rpcResponseVo = businessRestService.getBusinessAuthByBusinessId(businessId);
//        if (rpcResponseVo.isSuccess()) {
//            mddrpVo = new GetCertificationBusinessRpVo();
//            if (dxshAppUserChannel != null && channel == DxshAppUserChannelService.CHANNEL_MDD) {
//                BeanUtils.copyProperties(dxshAppUserChannel, mddrpVo);
////                dxshAppIndustryService.postHandleIsShowOther(dxshAppUserChannel,mddrpVo);
//
//            }
//            BusinessAuthDto businessAuthDto = rpcResponseVo.parseObject(BusinessAuthDto.class);
//            BeanUtils.copyProperties(businessAuthDto, mddrpVo);
//            mddrpVo.setBusinessId(businessAuthDto.getBmsBusinessId());
//
//
//
//        }
//
//
//        if (channel == DxshAppUserChannelService.CHANNEL_MINAPP) {
//            if (xcxrpVo != null) {
//                return ResultMapHelper.success(xcxrpVo, ResultMsg.MSG_GET_SUCCESS);
//            } else if (mddrpVo != null) {
//                return ResultMapHelper.success(mddrpVo, ResultMsg.MSG_GET_SUCCESS);
//            }
//        }
//        if (channel== DxshAppUserChannelService.CHANNEL_MDD) {
//            if (mddrpVo != null) {
//                return ResultMapHelper.success(mddrpVo, ResultMsg.MSG_GET_SUCCESS);
//            } else if (xcxrpVo != null) {
//                return ResultMapHelper.success(xcxrpVo, ResultMsg.MSG_GET_SUCCESS);
//            }
//        }
//
//
//        return ResultMapHelper.success(null, ResultMsg.MSG_GET_SUCCESS);
        return ResultMapHelper.success(mddrpVo, ResultMsg.MSG_GET_SUCCESS);
    }

    private DxshAppUserChannel getMddChannelByUserId(Integer userId) {
        //查看是否挑选默认店铺
        Integer businessId = dankMerchantsDefBusinessService.getChooseBusinessId(userId);
        QueryWrapper queryWrapper = new QueryWrapper();
        if(businessId != null) {
            queryWrapper.eq(DxshAppUserChannel.BUSINESS_ID, businessId);
        }
        queryWrapper.eq(DxshAppUserChannel.USER_ID,userId);
        queryWrapper.eq(DxshAppUserChannel.CHANNEL, DxshAppUserChannelService.CHANNEL_MDD);
        List<DxshAppUserChannel> dxshAppUserChannels = dxshAppUserChannelMapper.selectList(queryWrapper);
        if(CollectionUtils.isNotEmpty(dxshAppUserChannels)){
            return dxshAppUserChannels.get(0);
        }
        return null;
    }

    private void postHandleCerDataMdd(BusinessAuthDto businessAuthDto, GetCertificationBusinessRpVo mddrpVo){
        if (businessAuthDto.getLicenseStartTime() != null) {
            mddrpVo.setLicenseStartTime(LocalDateTime.ofInstant(businessAuthDto.getLicenseStartTime().toInstant(), ZoneId.systemDefault()));
        }
        if (businessAuthDto.getLicenseExpired() != null) {
            mddrpVo.setLicenseExpired(LocalDateTime.ofInstant(businessAuthDto.getLicenseExpired().toInstant(), ZoneId.systemDefault()));
        }
        if (businessAuthDto.getIdentityStartTime() != null) {
            mddrpVo.setIdentityStartTime(LocalDateTime.ofInstant(businessAuthDto.getIdentityStartTime().toInstant(), ZoneId.systemDefault()));
        }
        if (businessAuthDto.getIdentityExpired() != null) {
            mddrpVo.setIdentityExpired(LocalDateTime.ofInstant(businessAuthDto.getIdentityExpired().toInstant(), ZoneId.systemDefault()));
        }
    }

    @Override
    public Map<String, Object> switchQuickAccess(SwitchQuickAccessVo switchQuickAccessVo) {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq(DxshAppUserChannel.USER_ID,switchQuickAccessVo.getUserId());
        queryWrapper.eq(DxshAppUserChannel.ID,switchQuickAccessVo.getId());
        DxshAppUserChannel dxshAppUserChannel = dxshAppUserChannelMapper.selectOne(queryWrapper);
        if(dxshAppUserChannel == null){
            return  ResultMapHelper.failure("找不到该渠道");
        }

        if(dxshAppUserChannel.getIsShow()==Constants.COMMON_FLAG_FALSE_INT){
            dxshAppUserChannel.setIsShow(Constants.COMMON_FLAG_TRUE_INT);
        }else{
            dxshAppUserChannel.setIsShow(Constants.COMMON_FLAG_FALSE_INT);
        }
        dxshAppUserChannelMapper.updateById(dxshAppUserChannel);
        SwitchQuickAccessRpVo switchQuickAccessRpVo = BeanUtils.copyProperties(dxshAppUserChannel,SwitchQuickAccessRpVo.class);
        return ResultMapHelper.success(switchQuickAccessRpVo,ResultMsg.HAND_SUCCESS);
    }

    @Override
    public Map<String, Object> getMddChannelList(BaseRqVo baseRqVo) {

        Integer businessRole = bmsDxClientRoleService.getRoleId(baseRqVo.getUserId());

        Page<DxshAppUserChannel> page = new Page<>(baseRqVo.getPageNum(),baseRqVo.getPageSize());
        QueryWrapper<DxshAppUserChannel> queryWrapper = new QueryWrapper();
        queryWrapper.eq(DxshAppUserChannel.USER_ID,baseRqVo.getUserId());
//        queryWrapper.eq(DxshAppUserChannel.IS_FILL,Constants.COMMON_FLAG_TRUE_INT);
        queryWrapper.eq(DxshAppUserChannel.CHANNEL, DxshAppUserChannelService.CHANNEL_MDD);
        queryWrapper.orderByDesc(DxshAppUserChannel.IS_FILL + "=1");
        queryWrapper.orderByAsc(DxshAppUserChannel.NEW_TIME);
        IPage<DxshAppUserChannel> dxshAppUserChannelBoIPage = dxshAppUserChannelMapper.selectPage(page,queryWrapper);
        List<DxshAppUserChannel> dxshAppUserChannelList = new ArrayList<>();
        Map<String,Object> userData = null;
        if(Constants.MDD_DY_ROLE_ID == businessRole){
            pushDYChannel(dxshAppUserChannelList,baseRqVo.getUserId());
            userData = MybatisUtils.UserData(baseRqVo.getPageNum(),baseRqVo.getPageSize(),dxshAppUserChannelList.size());
        }else{
            dxshAppUserChannelList = dxshAppUserChannelBoIPage.getRecords();
            userData = MybatisUtils.UserData(dxshAppUserChannelBoIPage);
        }


        List<BannerRpVo> bannerRpVoList = dxshAppBannerService.bannerList(DxshAppBannerService.CHANNEL_MDD_TYPE);
        userData.put("banner",bannerRpVoList);
        if(dxshAppUserChannelList.size() > 0){
            List<ChannelBo> channelBoList = BeanUtils.copyList(dxshAppUserChannelList,ChannelBo.class);
            //处理觅东东
            GetMddBusinessDataByDxshAppDto getMddBusinessDataByDxshAppDto = new GetMddBusinessDataByDxshAppDto();

            Set<Integer> businessIds = channelBoList.stream()
                    .filter(v->CHANNEL_MDD == v.getChannel()  && v.getBusinessId()!=null)
                    .map(DxshAppUserChannel::getBusinessId).collect(Collectors.toSet());

            getMddBusinessDataByDxshAppDto.setBusinessIds(businessIds);
            RpcResponseVo rpcResponseVo = businessRestService.getMddBusinessDataByDxshApp(getMddBusinessDataByDxshAppDto);
            if(rpcResponseVo.isSuccess()){
                getMddBusinessDataByDxshAppDto = rpcResponseVo.parseObject(GetMddBusinessDataByDxshAppDto.class);
                for(ChannelBo q:channelBoList){
                    for(GetMddBusinessDataByDxshAppDto.BusinessDataDto dto:getMddBusinessDataByDxshAppDto.getBusinessDatas()){
                        if(  q.getChannel()==CHANNEL_MDD && q.getBusinessId().equals( dto.getBusinessId())){
                            q.setVendorName(dto.getVendorName());
                            q.setLoginUrl(dto.getLoginUrl());
                            if(Constants.MDD_DY_ROLE_ID != businessRole){
                                q.setGroupBuyNum(dto.getGroupBuyNum());
                                q.setVerNum(dto.getVerNum());
                            }

                        }
                    }
                }

            }

            channelBoList.forEach(bo->{
                dxshAppIndustryService.postHandleUserChannel(bo);
                bo.setBusinessRole(businessRole);
            });
            List<ChannelRpVo> channelRpVoList = BeanUtils.copyList(channelBoList,ChannelRpVo.class);

            return ResultMapHelper.success(channelRpVoList,userData,ResultMsg.MSG_GET_SUCCESS);
        }
        return ResultMapHelper.success(null,userData,ResultMsg.MSG_GET_SUCCESS);
    }


    @Override
    public List<DataRpVo.DxshAppQuickAccessVo>  getIndexQuickAccessData(Integer userId) {
        Integer businessRole = bmsDxClientRoleService.getRoleId(userId);

        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq(DxshAppUserChannel.USER_ID, userId);
        queryWrapper.eq(DxshAppUserChannel.IS_FILL, Constants.COMMON_FLAG_TRUE_INT);
        queryWrapper.eq(DxshAppUserChannel.IS_SHOW, Constants.COMMON_FLAG_TRUE_INT);
        queryWrapper.orderByDesc(DxshAppUserChannel.CLICK_TIME);
        List<DxshAppUserChannel> dxshAppUserChannelList = new ArrayList<>();
        if(Constants.MDD_DY_ROLE_ID == businessRole){
            pushDYChannel(dxshAppUserChannelList,userId);
        }else{
            dxshAppUserChannelList = dxshAppUserChannelMapper.selectList(queryWrapper);
        }
        if (dxshAppUserChannelList.size() > 0) {
            List<QuickAccessBo> quickAccessBoList = BeanUtils.copyList(dxshAppUserChannelList, QuickAccessBo.class);
            GetMddBusinessDataByDxshAppDto getMddBusinessDataByDxshAppDto = new GetMddBusinessDataByDxshAppDto();

            Set<Integer> businessIds = quickAccessBoList.stream()
                    .filter(v -> CHANNEL_MDD == v.getChannel() && v.getBusinessId() != null)
                    .map(DxshAppUserChannel::getBusinessId).collect(Collectors.toSet());

            getMddBusinessDataByDxshAppDto.setBusinessIds(businessIds);
            RpcResponseVo rpcResponseVo = businessRestService.getMddBusinessDataByDxshApp(getMddBusinessDataByDxshAppDto);
            if (rpcResponseVo.isSuccess()) {
                getMddBusinessDataByDxshAppDto = rpcResponseVo.parseObject(GetMddBusinessDataByDxshAppDto.class);
                for (QuickAccessBo q : quickAccessBoList) {
                    for (GetMddBusinessDataByDxshAppDto.BusinessDataDto dto : getMddBusinessDataByDxshAppDto.getBusinessDatas()) {
                        if (q.getChannel() == CHANNEL_MDD && q.getBusinessId().equals(dto.getBusinessId())) {
                            q.setVendorName(dto.getVendorName());
                            q.setLoginUrl(dto.getLoginUrl());
                            q.setGroupBuyNum(dto.getGroupBuyNum());
                            q.setVerNum(dto.getVerNum());
                            continue;
                        }
                    }
                }

            }
            //获取小程序的
            Set<String> minAppIds = quickAccessBoList.stream()
                    .filter(v -> CHANNEL_MINAPP == v.getChannel() && v.getMinAppId() != null && v.getIsFill() == Constants.COMMON_FLAG_TRUE_INT
                            && PatternMatchUtils.isNumeric(v.getMinAppId()))
                    .map(DxshAppUserChannel::getMinAppId).collect(Collectors.toSet());

            String url = AppConfig.getProperty("saas.dxshapp.center.service") + "/dxshApp/app/getByStoreIds";;
            String token = RequestHeaderData.getRequestHeaderData().getString("token");
            try {
                RpcResponseVo minrpcResponseVo = userRestService.getMiniTokenByUserId_v2(userId,token);
                if (minrpcResponseVo.isSuccess()) {
                    String minitoken = minrpcResponseVo.getData().toString();
                    String requestBody = RestTemplateUtils.
                            postForEntityForJsonByLoadBalanced(url, minAppIds, RestTemplateUtils.getSassHeader(minitoken));
                    JSONObject userJson = JSON.parseObject(requestBody);
                    if (userJson.containsKey("status") && ResultCode.CODE_NORMAL.equals(userJson.getString("status"))) {
                        JSONObject result = (JSONObject) userJson.get("data");
                        if (result != null) {
                            for (QuickAccessBo q : quickAccessBoList) {
                                if (q.getChannel() == CHANNEL_MINAPP && StringUtils.checkAnyNotNull(q.getMinAppId()) && result.containsKey(q.getMinAppId())) {
                                    MinAppDto minAppDto = JSON.parseObject(result.getString(q.getMinAppId()), MinAppDto.class);
                                    q.setVendorName(minAppDto.getName());
                                    q.setLoginUrl(minAppDto.getLogo());
                                    q.setOrderNum(minAppDto.getAppOrderCountData().getTodayOrderQuantity());
                                    q.setTurnover(minAppDto.getAppOrderCountData().getTodayOrderSum());
                                }
                            }
                        }
                    }
                }
            }catch (Exception e){
                log.error(e.getMessage(),e);
            }
            quickAccessBoList.forEach(bo->{
                bo.setBusinessRole(businessRole);
            });

            List<DataRpVo.DxshAppQuickAccessVo> dxshAppQuickAccessVoList = BeanUtils.copyList(quickAccessBoList, DataRpVo.DxshAppQuickAccessVo.class);
            return dxshAppQuickAccessVoList;
        }
        return null;
    }

    @Override
    public Map<String, Object> refreshQuickAccess(RefreshQuickAccessVo refreshQuickAccessVo) {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq(DxshAppUserChannel.USER_ID,refreshQuickAccessVo.getUserId());
        queryWrapper.eq(DxshAppUserChannel.ID,refreshQuickAccessVo.getChannelId());
        List<DxshAppUserChannel> dxshAppUserChannelList = list(queryWrapper);
        if(dxshAppUserChannelList.size() <= 0 ){
            return ResultMapHelper.failure(ResultMsg.CODE_ERROR_05);
        }
        DxshAppUserChannel dxshAppUserChannel = dxshAppUserChannelList.get(0);
        dxshAppUserChannel.setClickTime(LocalDateTime.now());
        saveOrUpdate(dxshAppUserChannel);
        return ResultMapHelper.success(null,"刷新成功");
    }

    @Override
    public Map<String, Object> getPayInfo(GetPayInfoVo getPayInfoVo) {
        RpcResponseVo rpcResponseVo =  businessInfoRestService.getBusinessInfo(getPayInfoVo.getBusinessId());
        if(rpcResponseVo.isSuccess()){
            GetBusinessInfoDto getBusinessInfoDto = rpcResponseVo.parseObject(GetBusinessInfoDto.class);
            GetPayInfoRpVo getPayInfoRpVo = BeanUtils.copyProperties(getBusinessInfoDto,GetPayInfoRpVo.class);
            return ResultMapHelper.success(getPayInfoRpVo,ResultMsg.MSG_GET_SUCCESS);
        }
        return ResultMapHelper.result(rpcResponseVo.getStatus(),rpcResponseVo.getMsg());
    }

    @Override
    public  Map<String, Object> getAllBusiness(BusinessRqVo businessRqVo) {
        GetMidongdongUserDto getMidongdongUserDto = new GetMidongdongUserDto();
        getMidongdongUserDto.setAccountId(businessRqVo.getAccountId());
        RpcResponseVo rpcResponseVo =  userRestService.getMidongdongUser(getMidongdongUserDto);
        if(rpcResponseVo.isSuccess()){
            getMidongdongUserDto = rpcResponseVo.parseObject(GetMidongdongUserDto.class);
            //获取到用户id
            Integer userId = getMidongdongUserDto.getUserId();
            //查出用户下面所有渠道
            QueryWrapper<DxshAppUserChannel> queryWrapper = new QueryWrapper();
            queryWrapper.eq(DxshAppUserChannel.USER_ID,userId);
            //queryWrapper.eq(DxshAppUserChannel.IS_FILL,Constants.COMMON_FLAG_TRUE_INT);
            queryWrapper.orderByAsc(DxshAppUserChannel.NEW_TIME);
            List<DxshAppUserChannel> dxshAppUserChannelList = dxshAppUserChannelMapper.selectList(queryWrapper);
            Map<Integer, List<DxshAppUserChannel>> dxshAppUserChannelMap = new HashMap<>();
            if(CollectionUtils.isNotEmpty(dxshAppUserChannelList)){
                for(DxshAppUserChannel dxshAppUserChannel : dxshAppUserChannelList){
                    if(!dxshAppUserChannelMap.containsKey(dxshAppUserChannel.getBusinessId())){
                        dxshAppUserChannelMap.put(dxshAppUserChannel.getBusinessId(),new ArrayList<>());
                    }
                    dxshAppUserChannelMap.get(dxshAppUserChannel.getBusinessId()).add(dxshAppUserChannel);
                }
            }
            Set<Integer> mddBusinessIds = dxshAppUserChannelList.stream()
                    .filter(v->CHANNEL_MDD == v.getChannel()  && v.getBusinessId()!=null)
                    .map(DxshAppUserChannel::getBusinessId).collect(Collectors.toSet());
            Set<Integer> minAppBusinessIds = dxshAppUserChannelList.stream()
                    .filter(v->CHANNEL_MINAPP == v.getChannel()  && v.getBusinessId()!=null)
                    .map(DxshAppUserChannel::getBusinessId).collect(Collectors.toSet());

            //合并店铺
            //Set<Integer> allIds = Stream.of(mddBusinessIds,minAppBusinessIds).flatMap(Collection::stream).distinct().collect(Collectors.toSet());
            //System.err.println(allIds);
            Set<Integer> allIds = new HashSet<>();
            allIds.addAll(mddBusinessIds);
            allIds.addAll(minAppBusinessIds);
            log.info("allIds:{}",JSON.toJSONString(allIds));
            GetMddBusinessDataByDxshAppDto getMddBusinessDataByDxshAppDto = new GetMddBusinessDataByDxshAppDto();
            getMddBusinessDataByDxshAppDto.setBusinessIds(allIds);
            RpcResponseVo mddRpcResponseVo = businessRestService.getMddBusinessDataByDxshApp(getMddBusinessDataByDxshAppDto);
            if(mddRpcResponseVo.isSuccess()){
                getMddBusinessDataByDxshAppDto = mddRpcResponseVo.parseObject(GetMddBusinessDataByDxshAppDto.class);
                List<BusinessInfoRpVo> businessInfoRpVos = BeanUtils.copyList(getMddBusinessDataByDxshAppDto.getBusinessDatas(),BusinessInfoRpVo.class);
                if(CollectionUtils.isNotEmpty(businessInfoRpVos)){
                    for(BusinessInfoRpVo businessInfoRpVo : businessInfoRpVos){
                        if(dxshAppUserChannelMap.containsKey(businessInfoRpVo.getBusinessId())){
                            List<DxshAppUserChannel> dxshAppUserChannel = dxshAppUserChannelMap.get(businessInfoRpVo.getBusinessId());
                            if(CollectionUtils.isNotEmpty(dxshAppUserChannel)){
                                businessInfoRpVo.getChannels().addAll(BeanUtils.copyList(dxshAppUserChannel, BusinessInfoRpVo.BusinessInfoRpChannel.class));
                            }
                        }
                    }
                }
                return ResultMapHelper.success(businessInfoRpVos,ResultMsg.MSG_GET_SUCCESS);
            }
            return ResultMapHelper.result(ResultCode.CODE_ERROR_05,ResultMsg.CODE_ERROR_05);
        }
        return ResultMapHelper.failure("用户不存在");
    }

    public static void main(String[] args) {
        Set<Integer> a = new HashSet<>();
        Set<Integer> b = new HashSet<>();
        Set<Integer> c = new HashSet<>();
        c =  Stream.of(a,b).flatMap(Collection::stream).distinct().collect(Collectors.toSet());
        System.out.println(c);
    }

    //店员专属添加渠道
    public void pushDYChannel(List<DxshAppUserChannel> dxshAppUserChannelList ,Integer userId){
        List<BmsUserBusiness> bmsUserBusinessList = bmsUserBusinessService.getBmsUserBusinessList(userId);
        //查詢這家點的狀態
        if(CollectionUtils.isNotEmpty(bmsUserBusinessList)){
            QueryWrapper queryWrapper = new QueryWrapper();
            queryWrapper.eq(DxshAppUserChannel.BUSINESS_ID,bmsUserBusinessList.get(0).getBmsBusinessId());
            queryWrapper.eq(DxshAppUserChannel.CHANNEL, DxshAppUserChannelService.CHANNEL_MDD);
            List<DxshAppUserChannel> dx = dxshAppUserChannelMapper.selectList(queryWrapper);
            bmsUserBusinessList.forEach(v->{
                DxshAppUserChannel dxshAppUserChannel = new DxshAppUserChannel();
                dxshAppUserChannel.setUserId(userId);
                dxshAppUserChannel.setBusinessId(v.getBmsBusinessId());
                dxshAppUserChannel.setChannel(DxshAppUserChannelService.CHANNEL_MDD);
                dxshAppUserChannel.setIsShow(Constants.COMMON_FLAG_TRUE_INT);
                dxshAppUserChannel.setBusinessRole(4);
                dxshAppUserChannel.setIsFill(Constants.COMMON_FLAG_FALSE_INT);
                if(CollectionUtils.isNotEmpty(dx)) {
                    dxshAppUserChannel.setIsFill(dx.get(0).getIsFill());
                }
                dxshAppUserChannelList.add(dxshAppUserChannel);
            });
        }
    }


    @Override
    public Map<String, Object> getMyStore(Integer userId,Integer pageNum,Integer pageSzie) {
        Integer businessId = dankMerchantsDefBusinessService.getChooseBusinessId(userId);
        return getMyStore(userId,businessId);
//        String token = RequestHeaderData.getRequestHeaderData().getString("token");
//        RpcResponseVo rpcResponseVo = userRoleRestService.getUserRoleAndUserPermission(userId);
//        if(!rpcResponseVo.isSuccess()){
//            return ResultMapHelper.result(ResultCode.CODE_ERROR_100,ResultMsg.MSG_NO_CONFIRM_ROLE);
//        }
//        JSONObject jsonObject = rpcResponseVo.parseObject(JSONObject.class);
//        List<Integer> roleIds = (List<Integer>) jsonObject.get("roleIds");
//        List<Integer> userPermissionIds = (List<Integer>) jsonObject.get("userPermissions");
//        GetMyStoreRpVo getMyStoreRpVo = new GetMyStoreRpVo();
//        List<BannerRpVo> bannerRpVos = dxshAppBannerService.bannerList(DxshAppBannerService.STORE_ADVERTISING_TYPE);
//        getMyStoreRpVo.setBanners(bannerRpVos);
//        Map<String,Object> userData = MybatisUtils.defaultUserData(0,0,0);
//        if(roleIds.contains(Constants.MDD_DY_ROLE_ID)){
//            userData.put("pageNum",pageNum);
//            userData.put("pageSize",pageSzie);
//            //查询当前用户是店员的店铺
//            QueryWrapper queryWrapper = new QueryWrapper();
//            queryWrapper.eq(BmsUserBusiness.BMS_USER_ID,userId);
//            List<BmsUserBusiness> bmsUserBusinesses = bmsUserBusinessService.list(queryWrapper);
//            if(CollectionUtils.isNotEmpty(bmsUserBusinesses)){
//                BmsUserBusiness bmsUserBusiness = bmsUserBusinesses.get(0);
//                rpcResponseVo = businessAuthRestService.getBusinessAuth(bmsUserBusiness.getBmsBusinessId());
//                if(rpcResponseVo.isSuccess()){
//                    userData.put("count",1);
//                    JSONObject data = rpcResponseVo.parseObject(JSONObject.class);
//                    JSONObject business = data.getJSONObject("bmsBusiness");
//                    List<GetMyStoreRpVo.StoresVo> storesVos = new ArrayList<>();
//                    GetMyStoreRpVo.StoresVo storesVo = new GetMyStoreRpVo.StoresVo();
//                    storesVos.add(storesVo);
//                    storesVo.setVendorName(business.getString("vendorName"));
//                    storesVo.setLogoUrl(business.getString("logoUrl"));
//                    storesVo.setAddr(String.format("%s-%s",business.getString("addrCity"),business.getString("addrDistrict")));
//                    storesVo.setLabelName(business.getString("label"));
//                    storesVo.setTypeName(business.getString("tags"));
//                    storesVo.setBusinessId(business.getInteger("id"));
//                    if(business.containsKey("bmsBusinessType")) {
//                        JSONObject bmsBusinessType = business.getJSONObject("bmsBusinessType");
//                        if(bmsBusinessType.containsKey("fontColor") && StringUtils.isNotBlank(bmsBusinessType.getString("fontColor"))) {
//                            storesVo.setFontColor(bmsBusinessType.getString("fontColor"));
//                        }
//                        if(bmsBusinessType.containsKey("backColor") && StringUtils.isNotBlank(bmsBusinessType.getString("backColor"))) {
//                            storesVo.setBackColor(bmsBusinessType.getString("backColor"));
//                        }
//                    }
//                    if(userPermissionIds.contains(Constants.VER_PERMISSION)){
//                        storesVo.setIsCanVer(Constants.COMMON_FLAG_TRUE_INT);
//                    }
//                    List<GetMyStoreRpVo.ChannelVo> channelVos = new ArrayList<>();
//                    GetMyStoreRpVo.ChannelVo channelVo  = new GetMyStoreRpVo.ChannelVo();
//                    //查出管理员的渠道信息
//                    queryWrapper.clear();
//                    queryWrapper.eq(DxshAppUserChannel.BUSINESS_ID,storesVo.getBusinessId());
//                    queryWrapper.eq(DxshAppUserChannel.CHANNEL,DxshAppUserChannelService.CHANNEL_MDD);
//                    List<DxshAppUserChannel> dxData = dxshAppUserChannelMapper.selectList(queryWrapper);
//                    if(CollectionUtils.isNotEmpty(dxData)){
//                        DxshAppUserChannel dxshAppUserChannel = dxData.get(0);
//                        BeanUtils.copyProperties(dxshAppUserChannel,channelVo);
//                    }
//                    channelVos.add(channelVo);
//                    channelVo.setChannel(DxshAppUserChannelService.CHANNEL_MDD);
//                    channelVo.setId(Constants.COMMON_FLAG_FALSE_INT);
//                    storesVo.setChannels(channelVos);
//                    getMyStoreRpVo.setStores(storesVos);
//                }
//            }
//        }else {
//            rpcResponseVo = businessAuthRestService.getUserClaimBusinessByUserIdPage(userId,pageNum,pageSzie);
//            if (rpcResponseVo.isSuccess()) {
//                userData.putAll(rpcResponseVo.getUserData());
//                List<GetUserClaimBusinessRpDto> getUserClaimBusinessRpDto = rpcResponseVo.parseArray(GetUserClaimBusinessRpDto.class);
//                if (CollectionUtils.isNotEmpty(getUserClaimBusinessRpDto)) {
//                    List<GetMyStoreRpVo.StoresVo> storesVos = new ArrayList<>();
//                    getUserClaimBusinessRpDto.forEach(gr -> {
//                        GetMyStoreRpVo.StoresVo storesVo = new GetMyStoreRpVo.StoresVo();
//                        storesVo.setVendorName(gr.getVendorName());
//                        storesVo.setLogoUrl(gr.getLogoUrl());
//                        storesVo.setAddr(String.format("%s-%s",gr.getAddrCity(),gr.getAddrDistrict()));
//                        storesVo.setLabelName(gr.getLabelName());
//                        storesVo.setTypeName(gr.getTypeName());
//                        storesVo.setBusinessId(gr.getBusinessId());
//                        if(StringUtils.isNotBlank(gr.getFontColor())) {
//                            storesVo.setFontColor(gr.getFontColor());
//                        }
//                        if(StringUtils.isNotBlank(gr.getBackColor())) {
//                            storesVo.setBackColor(gr.getBackColor());
//                        }
//                        storesVos.add(storesVo);
//                    });
//                    getMyStoreRpVo.setStores(storesVos);
//                }
//                //查出拥有这些店铺的渠道
//                Map<Integer, List<DxshAppUserChannel>> dxshAppUserChannelMap = this.getBusinssAllChannel(userId);
//                List<GetMyStoreRpVo.StoresVo> storesVos = getMyStoreRpVo.getStores();
//                Set<Integer> updateMinAppStatus = new HashSet<>();
//                Map<Integer,DxshAppUserChannel> dMap = new HashMap<>();
//                Set<String> minAppId = new HashSet<>();
//                storesVos.forEach(sv -> {
//                    if (dxshAppUserChannelMap.containsKey(sv.getBusinessId())) {
//                        List<DxshAppUserChannel> dxshAppUserChannels = dxshAppUserChannelMap.get(sv.getBusinessId());
//                        dxshAppUserChannels.forEach(dc -> {
//                            if(dc.getChannel() == DxshAppUserChannelService.CHANNEL_MINAPP){
//                                if(StringUtils.isNotBlank(dc.getMinAppId())){
//                                    dMap.put(dc.getId(),dc);
//                                    minAppId.add(dc.getMinAppId());
//                                }
//                            }
//                            GetMyStoreRpVo.ChannelVo channelVo = BeanUtils.copyProperties(dc, GetMyStoreRpVo.ChannelVo.class);
//                            sv.getChannels().add(channelVo);
//                            if(channelVo.getChannel() == DxshAppUserChannelService.CHANNEL_MDD
//                                    && channelVo.getIsFill() == Constants.COMMON_FLAG_TRUE_INT){
//                                sv.setIsCanVer(Constants.COMMON_FLAG_TRUE_INT);
//                            }
//                        });
//                    }
//                });
//                if(minAppId.size() > 0){
//                    //获取
//                    Map<String,JSONObject> minAppData = this.getMinAppDataByIds(minAppId,userId,token);
//                    storesVos.forEach(sv -> {
//                        List<GetMyStoreRpVo.ChannelVo> channelVos = sv.getChannels();
//                        if(CollectionUtils.isNotEmpty(channelVos)){
//                            channelVos.forEach(cv -> {
//                                if(cv.getChannel() == DxshAppUserChannelService.CHANNEL_MINAPP){
//                                    if(minAppData.containsKey(cv.getMinAppId())){
//                                        JSONObject minApp = minAppData.get(cv.getMinAppId());
//                                        if(minApp.containsKey("status")){
//                                            cv.setAppStatus(minApp.getInteger("status"));
//                                            if(cv.getAppStatus() == Constants.MINAPP_STATUS_CREATE_FAIL){
//                                                updateMinAppStatus.add(cv.getId());
//                                                cv.setIsFill(Constants.COMMON_FLAG_FALSE_INT);
//                                                cv.setIsFinish(Constants.COMMON_FLAG_FALSE_INT);
//                                            }
//                                        }
//                                        if(minApp.containsKey("wxReleaseStep")){
//                                            cv.setWxReleaseStep(minApp.getInteger("wxReleaseStep"));
//                                        }
//                                        if(minApp.containsKey("wxReleaseStatus")){
//                                            cv.setWxReleaseStatus(minApp.getString("wxReleaseStatus"));
//                                        }
//                                    }
//                                }
//                            });
//                        }
//                    });
//                }
//                postUpdateMinAppStatus(updateMinAppStatus,dMap);
//            }
//        }
//        if(getMyStoreRpVo.getStores().size() > 0){
//            for(GetMyStoreRpVo.StoresVo storesVo : getMyStoreRpVo.getStores()){
//                List<GetMyStoreRpVo.ChannelVo> bos = storesVo.getChannels();
//                for(GetMyStoreRpVo.ChannelVo c : bos){
//                    if(c.getChannel() == 1 && c.getBusinessId() == 4149){
//                        c.setAppStatus(7);
//                        c.setWxReleaseStep(2);
//                        c.setWxReleaseStatus("failure");
//                    }
//                }
//            }
//        }
//        return ResultMapHelper.success(getMyStoreRpVo,userData,ResultMsg.MSG_GET_SUCCESS);
    }

    public Map<String, Object> getMyStore(Integer userId,Integer businessId) {
        String token = RequestHeaderData.getRequestHeaderData().getString("token");
        RpcResponseVo rpcResponseVo = userRoleRestService.getUserRoleAndUserPermission(userId);
        if(!rpcResponseVo.isSuccess()){
            return ResultMapHelper.result(ResultCode.CODE_ERROR_100,ResultMsg.MSG_NO_CONFIRM_ROLE);
        }
        JSONObject jsonObject = rpcResponseVo.parseObject(JSONObject.class);
        List<Integer> roleIds = (List<Integer>) jsonObject.get("roleIds");
        List<Integer> userPermissionIds = (List<Integer>) jsonObject.get("userPermissions");
        GetMyStoreRpVo getMyStoreRpVo = new GetMyStoreRpVo();
        List<BannerRpVo> bannerRpVos = dxshAppBannerService.bannerList(DxshAppBannerService.STORE_ADVERTISING_TYPE);
        getMyStoreRpVo.setBanners(bannerRpVos);
        if(roleIds.contains(Constants.MDD_DY_ROLE_ID)){
            //查询当前用户是店员的店铺
            List<BmsUserBusiness> bmsUserBusinesses = bmsUserBusinessService.getBmsUserBusinessList(userId);
            if(CollectionUtils.isNotEmpty(bmsUserBusinesses)){
                BmsUserBusiness bmsUserBusiness = bmsUserBusinesses.get(0);
                rpcResponseVo = businessAuthRestService.getBusinessAuth(bmsUserBusiness.getBmsBusinessId());
                if(rpcResponseVo.isSuccess()){
                    JSONObject data = rpcResponseVo.parseObject(JSONObject.class);
                    JSONObject business = data.getJSONObject("bmsBusiness");
                    List<GetMyStoreRpVo.StoresVo> storesVos = new ArrayList<>();
                    GetMyStoreRpVo.StoresVo storesVo = new GetMyStoreRpVo.StoresVo();
                    storesVos.add(storesVo);
                    storesVo.setVendorName(business.getString("vendorName"));
                    storesVo.setLogoUrl(business.getString("logoUrl"));
                    storesVo.setAddr(String.format("%s-%s",business.getString("addrCity"),business.getString("addrDistrict")));
                    storesVo.setLabelName(business.getString("label"));
                    storesVo.setTypeName(business.getString("tags"));
                    storesVo.setBusinessId(business.getInteger("id"));
                    if(business.containsKey("bmsBusinessType")) {
                        JSONObject bmsBusinessType = business.getJSONObject("bmsBusinessType");
                        if(bmsBusinessType.containsKey("fontColor") && StringUtils.isNotBlank(bmsBusinessType.getString("fontColor"))) {
                            storesVo.setFontColor(bmsBusinessType.getString("fontColor"));
                        }
                        if(bmsBusinessType.containsKey("backColor") && StringUtils.isNotBlank(bmsBusinessType.getString("backColor"))) {
                            storesVo.setBackColor(bmsBusinessType.getString("backColor"));
                        }
                    }
                    if(userPermissionIds.contains(Constants.VER_PERMISSION)){
                        storesVo.setIsCanVer(Constants.COMMON_FLAG_TRUE_INT);
                    }
                    List<GetMyStoreRpVo.ChannelVo> channelVos = new ArrayList<>();
                    GetMyStoreRpVo.ChannelVo channelVo  = new GetMyStoreRpVo.ChannelVo();
                    //查出管理员的渠道信息
                    QueryWrapper queryWrapper = new QueryWrapper();
                    queryWrapper.eq(DxshAppUserChannel.BUSINESS_ID,storesVo.getBusinessId());
                    queryWrapper.eq(DxshAppUserChannel.CHANNEL, DxshAppUserChannelService.CHANNEL_MDD);
                    List<DxshAppUserChannel> dxData = dxshAppUserChannelMapper.selectList(queryWrapper);
                    if(CollectionUtils.isNotEmpty(dxData)){
                        DxshAppUserChannel dxshAppUserChannel = dxData.get(0);
                        BeanUtils.copyProperties(dxshAppUserChannel,channelVo);
                    }
                    channelVos.add(channelVo);
                    channelVo.setChannel(DxshAppUserChannelService.CHANNEL_MDD);
                    channelVo.setId(Constants.COMMON_FLAG_FALSE_INT);
                    storesVo.setChannels(channelVos);
                    getMyStoreRpVo.setStores(storesVos);
                }
            }
        }else {
            if(businessId == null){
                return ResultMapHelper.success(getMyStoreRpVo,ResultMsg.MSG_GET_SUCCESS);
            }
            rpcResponseVo = businessAuthRestService.getUserClaimBusinessByBusinessId(businessId);
            if (rpcResponseVo.isSuccess()) {
                List<GetUserClaimBusinessRpDto> getUserClaimBusinessRpDto = new ArrayList<>();
                GetUserClaimBusinessRpDto gt = rpcResponseVo.parseObject(GetUserClaimBusinessRpDto.class);
                getUserClaimBusinessRpDto.add(gt);
                if (CollectionUtils.isNotEmpty(getUserClaimBusinessRpDto)) {
                    List<GetMyStoreRpVo.StoresVo> storesVos = new ArrayList<>();
                    getUserClaimBusinessRpDto.forEach(gr -> {
                        GetMyStoreRpVo.StoresVo storesVo = new GetMyStoreRpVo.StoresVo();
                        storesVo.setVendorName(gr.getVendorName());
                        storesVo.setLogoUrl(gr.getLogoUrl());
                        storesVo.setAddr(String.format("%s-%s",gr.getAddrCity(),gr.getAddrDistrict()));
                        storesVo.setLabelName(gr.getLabelName());
                        storesVo.setTypeName(gr.getTypeName());
                        storesVo.setBusinessId(gr.getBusinessId());
                        if(StringUtils.isNotBlank(gr.getFontColor())) {
                            storesVo.setFontColor(gr.getFontColor());
                        }
                        if(StringUtils.isNotBlank(gr.getBackColor())) {
                            storesVo.setBackColor(gr.getBackColor());
                        }
                        storesVos.add(storesVo);
                    });
                    getMyStoreRpVo.setStores(storesVos);
                }
                //查出拥有这些店铺的渠道
                List<DxshAppUserChannel> dxshAppUserChannels = this.getBusinssAllChannel(userId,businessId);
                List<GetMyStoreRpVo.StoresVo> storesVos = getMyStoreRpVo.getStores();
                Set<Integer> updateMinAppStatus = new HashSet<>();
                Map<Integer,DxshAppUserChannel> dMap = new HashMap<>();
                Set<String> minAppId = new HashSet<>();
                storesVos.forEach(sv -> {
                    dxshAppUserChannels.forEach(dc -> {
                        if(dc.getChannel() == DxshAppUserChannelService.CHANNEL_MINAPP){
                            if(StringUtils.isNotBlank(dc.getMinAppId())){
                                dMap.put(dc.getId(),dc);
                                minAppId.add(dc.getMinAppId());
                            }
                        }
                        GetMyStoreRpVo.ChannelVo channelVo = BeanUtils.copyProperties(dc, GetMyStoreRpVo.ChannelVo.class);
                        sv.getChannels().add(channelVo);
                        if(channelVo.getChannel() == DxshAppUserChannelService.CHANNEL_MDD
                                && channelVo.getIsFill() == Constants.COMMON_FLAG_TRUE_INT){
                            sv.setIsCanVer(Constants.COMMON_FLAG_TRUE_INT);
                        }
                    });
                });
                if(minAppId.size() > 0){
                    //获取
                    Map<String,JSONObject> minAppData = this.getMinAppDataByIds(minAppId,userId,token);
                    log.info("minAppData:{}",JSON.toJSONString(minAppData));
                    storesVos.forEach(sv -> {
                        List<GetMyStoreRpVo.ChannelVo> channelVos = sv.getChannels();
                        if(CollectionUtils.isNotEmpty(channelVos)){
                            channelVos.forEach(cv -> {
                                if(cv.getChannel() == DxshAppUserChannelService.CHANNEL_MINAPP){
                                    if(minAppData.containsKey(cv.getMinAppId())){
                                        JSONObject minApp = minAppData.get(cv.getMinAppId());
                                        if(minApp.containsKey("status")){
                                            cv.setAppStatus(minApp.getInteger("status"));
                                            if(cv.getAppStatus() == Constants.MINAPP_STATUS_CREATE_FAIL){
                                                updateMinAppStatus.add(cv.getId());
                                                cv.setIsFill(Constants.COMMON_FLAG_FALSE_INT);
                                                cv.setIsFinish(Constants.COMMON_FLAG_FALSE_INT);
                                            }
                                        }
                                        if(minApp.containsKey("wxReleaseStep")){
                                            cv.setWxReleaseStep(minApp.getInteger("wxReleaseStep"));
                                        }
                                        if(minApp.containsKey("wxReleaseStatus")){
                                            cv.setWxReleaseStatus(minApp.getString("wxReleaseStatus"));
                                        }
                                        if(minApp.containsKey("name")){
                                            cv.setMinAppName(minApp.getString("name"));
                                        }
                                    }
                                }
                            });
                        }
                    });
                }
                postUpdateMinAppStatus(updateMinAppStatus,dMap);
            }
        }

        return ResultMapHelper.success(getMyStoreRpVo,ResultMsg.MSG_GET_SUCCESS);
    }

    @Override
    public String getMinAppIndexUrl() {
        RpcResponseVo rpcResponseVo = apiConfigRestService.getDxshAppConfig();
        if(rpcResponseVo.isSuccess()){
            Map<String,Object> data = (Map<String, Object>) rpcResponseVo.getData();
            if(data.containsKey("MINAPP")){
                Map<String,Object> minAppData = (Map<String, Object>) data.get("MINAPP");
                if(minAppData.containsKey("minappUrl")){
                    return minAppData.get("minappUrl").toString();
                }
            }
        }
        return "";
    }

    @Override
    public Map<String, Object> addChannel_v2(Integer userId, Integer channel) {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq(DxshAppUserChannel.USER_ID,userId);
        queryWrapper.eq(DxshAppUserChannel.CHANNEL,channel);
        List<DxshAppUserChannel> dxshAppUserChannels = dxshAppUserChannelMapper.selectList(queryWrapper);
        if(!CollectionUtils.isNotEmpty(dxshAppUserChannels)){
            DxshAppUserChannel dxshAppUserChannel = new DxshAppUserChannel();
            dxshAppUserChannel.setChannel(channel);
            dxshAppUserChannel.setUserId(userId);
            dxshAppUserChannel.setIsFill(DxshAppUserChannelService.IS_FILL_CODE_4);
            if(dxshAppUserChannel.getChannel() == DxshAppUserChannelService.CHANNEL_MINAPP){
                dxshAppUserChannel.setIsFill(Constants.COMMON_FLAG_FALSE_INT);
            }
            dxshAppUserChannelMapper.insert(dxshAppUserChannel);
            dxshAppUserChannels.add(dxshAppUserChannel);
        }
        DxshAppUserChannel dxshAppUserChannel = dxshAppUserChannels.get(0);
        GetMyAllChannelRpVo.StoresVo storesVo = BeanUtils.copyProperties(dxshAppUserChannel, GetMyAllChannelRpVo.StoresVo.class);
        return ResultMapHelper.success(storesVo,ResultMsg.MSG_GET_SUCCESS);
    }

    @Override
    public Map<String, Object> getMyAllChannel(Integer userId,Integer pageNum,Integer pageSize) {
        Integer businessId = dankMerchantsDefBusinessService.getChooseBusinessId(userId);
        String token = RequestHeaderData.getRequestHeaderData().getString("token");
        RpcResponseVo rpcResponseVo = userRoleRestService.getUserRoleAndUserPermission(userId);
        if(!rpcResponseVo.isSuccess()){
            return ResultMapHelper.result(ResultCode.CODE_ERROR_100,ResultMsg.MSG_NO_CONFIRM_ROLE);
        }
        JSONObject jsonObject = rpcResponseVo.parseObject(JSONObject.class);
        List<Integer> roleIds = (List<Integer>) jsonObject.get("roleIds");
        List<Integer> userPermissionIds = (List<Integer>) jsonObject.get("userPermissions");
        GetMyAllChannelRpVo getMyStoreRpVo = new GetMyAllChannelRpVo();
        if(roleIds.contains(Constants.MDD_DY_ROLE_ID)){
            //查询当前用户是店员的店铺
            QueryWrapper queryWrapper = new QueryWrapper();
            List<BmsUserBusiness> bmsUserBusinesses = bmsUserBusinessService.getBmsUserBusinessList(userId);
            if(CollectionUtils.isNotEmpty(bmsUserBusinesses)){
                BmsUserBusiness bmsUserBusiness = bmsUserBusinesses.get(0);
                rpcResponseVo = businessAuthRestService.getBusinessAuth(bmsUserBusiness.getBmsBusinessId());
                if(rpcResponseVo.isSuccess()){
                    JSONObject data = rpcResponseVo.parseObject(JSONObject.class);
                    JSONObject business = data.getJSONObject("bmsBusiness");
                    List<GetMyAllChannelRpVo.StoresVo> storesVos = new ArrayList<>();
                    GetMyAllChannelRpVo.StoresVo storesVo = new GetMyAllChannelRpVo.StoresVo();
                    storesVos.add(storesVo);
                    storesVo.setChannelName(business.getString("vendorName"));
//                    storesVo.setLogoUrl(business.getString("logoUrl"));
//                    storesVo.setAddr(String.format("%s-%s",business.getString("addrCity"),business.getString("addrDistrict")));
//                    storesVo.setLabelName(business.getString("label"));
//                    storesVo.setTypeName(business.getString("tags"));
                    storesVo.setBusinessId(business.getInteger("id"));
                    if(business.containsKey("bmsBusinessType")) {
                        JSONObject bmsBusinessType = business.getJSONObject("bmsBusinessType");
//                        if(bmsBusinessType.containsKey("fontColor") && StringUtils.isNotBlank(bmsBusinessType.getString("fontColor"))) {
//                            storesVo.setFontColor(bmsBusinessType.getString("fontColor"));
//                        }
//                        if(bmsBusinessType.containsKey("backColor") && StringUtils.isNotBlank(bmsBusinessType.getString("backColor"))) {
//                            storesVo.setBackColor(bmsBusinessType.getString("backColor"));
//                        }
                    }

                    List<GetMyAllChannelRpVo.ChannelVo> channelVos = new ArrayList<>();
                    GetMyAllChannelRpVo.ChannelVo channelVo  = new GetMyAllChannelRpVo.ChannelVo();
                    //查出管理员的渠道信息
                    queryWrapper.clear();
                    queryWrapper.eq(DxshAppUserChannel.BUSINESS_ID,storesVo.getBusinessId());
                    queryWrapper.eq(DxshAppUserChannel.CHANNEL, DxshAppUserChannelService.CHANNEL_MDD);
                    List<DxshAppUserChannel> dxData = dxshAppUserChannelMapper.selectList(queryWrapper);
                    if(CollectionUtils.isNotEmpty(dxData)){
                        DxshAppUserChannel dxshAppUserChannel = dxData.get(0);
                        storesVo.setId(dxshAppUserChannel.getId());
                        storesVo.setChannel(dxshAppUserChannel.getChannel());
                        BeanUtils.copyProperties(dxshAppUserChannel,channelVo);
                    }
                    channelVos.add(channelVo);
                    channelVo.setChannel(DxshAppUserChannelService.CHANNEL_MDD);
                    channelVo.setId(Constants.COMMON_FLAG_FALSE_INT);
                    //storesVo.setChannels(channelVos);
                    getMyStoreRpVo.setChannels(storesVos);
                }
            }
        }else {
            RpcResponseVo responseVo = businessRestService.getUserClaimBusiness(userId,Constants.COMMON_FLAG_FALSE_INT);
            if(!responseVo.isSuccess()) {
                return ResultMapHelper.result(ResultCode.CODE_ERROR_100,ResultMsg.HAND_FAIL);
            }
            //查出店铺数据
            Map<Integer,GetUserClaimBusinessRpDto> getUserClaimBusinessRpDtoMap = new HashMap<>();
            List<GetUserClaimBusinessRpDto> getUserClaimBusinessRpDtos = responseVo.parseArray(GetUserClaimBusinessRpDto.class);
            if(CollectionUtils.isNotEmpty(getUserClaimBusinessRpDtos)){
                for(GetUserClaimBusinessRpDto getUserClaimBusinessRpDto : getUserClaimBusinessRpDtos) {
                    getUserClaimBusinessRpDtoMap.put(getUserClaimBusinessRpDto.getBusinessId(),getUserClaimBusinessRpDto);
                }
            }
            int count = getUserClaimBusinessRpDtos.size();
            log.info("count : {}",count);
            //单店铺默认选择行业
            List<DxshAppUserChannel> dxshAppUserChannels = new ArrayList<>();
            if(count <= 1 ){
                //新账号
                dxshAppUserChannels.addAll(this.getUserAllChannel(userId));
            }else if(count > 1) {
                //同步数据
                //同步数据
                this.syncMddForDankData(getUserClaimBusinessRpDtos);
                dxshAppUserChannels.addAll(this.getBusinssAllChannel(userId,businessId));
            }
            Map<Integer,DxshAppUserChannel> dMap = new HashMap<>();
            Set<String> storeIds = new HashSet<>();
            Set<Integer> businessAuthIds = new HashSet<>();
            Set<Integer> businessIds = new HashSet<>();
            Set<Integer> chooseMinIndustryIds = new HashSet<>();
            if(CollectionUtils.isNotEmpty(dxshAppUserChannels)){
                businessAuthIds = dxshAppUserChannels.stream().map(DxshAppUserChannel::getBusinessAuthId).collect(Collectors.toSet());
                storeIds = dxshAppUserChannels.stream().filter(dUserChannel -> dUserChannel.getStoreId() != null && dUserChannel.getChannel() == DxshAppUserChannelService.CHANNEL_MINAPP).map(DxshAppUserChannel::getStoreId).collect(Collectors.toSet());
                businessIds = dxshAppUserChannels.stream().filter(dUserChannel -> dUserChannel.getBusinessId() != null && dUserChannel.getChannel() == DxshAppUserChannelService.CHANNEL_MDD).map(DxshAppUserChannel::getBusinessId).collect(Collectors.toSet());
                chooseMinIndustryIds = dxshAppUserChannels.stream().map(DxshAppUserChannel::getChooseMinIndustryId).collect(Collectors.toSet());
            }
            Map<String,JSONObject> minAppData = new HashMap<>();
            Map<String,DxshAppMinappInfo> dxshAppMinappInfoMap = new HashMap<>();
            if(storeIds.size() > 0){
                minAppData.putAll(this.getMinAppDataByIds(storeIds,userId,token));
                log.info("minAppData:{}",JSON.toJSONString(minAppData));
                dxshAppMinappInfoMap.putAll(dxshAppMinappInfoService.getMapByStoreIds(storeIds));
            }
            Map<Integer,DxshAppIndustryChild> dxshAppIndustryChildMap = new HashMap<>();
            if(chooseMinIndustryIds.size() > 0){
                dxshAppIndustryChildMap.putAll(dxshAppIndustryChildService.getMapByIds(chooseMinIndustryIds));
            }
//            if(businessAuthIds.size() > 0){
//                rpcResponseVo = businessAuthRestService.getUserClaimBusinessByBusinessAuthIds(JSON.toJSONString(businessAuthIds));
//                if(rpcResponseVo.isSuccess()){
//                    List<GetUserClaimBusinessRpDto> getUserClaimBusinessRpDtos = rpcResponseVo.parseArray(GetUserClaimBusinessRpDto.class);
//                    if(CollectionUtils.isNotEmpty(getUserClaimBusinessRpDtos)){
//                        for(GetUserClaimBusinessRpDto getUserClaimBusinessRpDto : getUserClaimBusinessRpDtos) {
//                            getUserClaimBusinessRpDtoMap.put(getUserClaimBusinessRpDto.getBusinessId(),getUserClaimBusinessRpDto);
//                        }
//                    }
//                }
//            }
            //查出觅东东店铺的未读消息
            Map<Integer,Integer> countNewNoReadNumMap = dxshAppNewsService.countByMddNoReadMessage(businessIds);
            Map<String,Integer> countNewNoReadNumMinApp = dxshAppNewsService.countByMinAppNoReadMessage(storeIds);
            for(DxshAppUserChannel dc : dxshAppUserChannels){
                GetMyAllChannelRpVo.StoresVo storesVo = new GetMyAllChannelRpVo.StoresVo();
                postHandleDcDataToStoresVo(dc,storesVo);
                if(dc.getChannel() == DxshAppUserChannelService.CHANNEL_MDD){
                    if(getUserClaimBusinessRpDtoMap.containsKey(dc.getBusinessId())) {
                        storesVo.setChannelName(getUserClaimBusinessRpDtoMap.get(dc.getBusinessId()).getVendorName());
                    }
                    if(countNewNoReadNumMap.containsKey(dc.getBusinessId())){
                        storesVo.setNewNums(countNewNoReadNumMap.get(dc.getBusinessId()));
                    }
                }else if(dc.getChannel() == DxshAppUserChannelService.CHANNEL_MINAPP){
                    if(countNewNoReadNumMinApp.containsKey(dc.getStoreId())){
                        storesVo.setNewNums(countNewNoReadNumMinApp.get(dc.getStoreId()));
                    }
                    if(minAppData.containsKey(dc.getStoreId())){
                        JSONObject jo = minAppData.get(dc.getStoreId());
                        storesVo.setMinAppBodies(postHandleMinAppFastMenu(jo,token));
                        dc.setMinAppBodies(JSON.toJSONString(storesVo.getMinAppBodies()));
                        dc.setAppid(jo.getString("appid"));
                        dc.setMinAppName(jo.getString("name"));
                        dc.setDemoId(jo.getString("demoId"));
                        storesVo.setChannelName(dc.getMinAppName());
                        storesVo.setAppid(dc.getAppid());
                        //设置小程序状态
                        postHanleMinAppStatus(jo,dc);
                        postHandleMinAppAuditStatus(jo,dc);
                        postHandleMinappBaseInfoStatus(jo,dc);
                        postHandleMinAppManInfoStatus(jo,dc);
                        storesVo.setMinAppStatus(dc.getMinAppStatus());
                        //处理小程序模板
                        postHandleMinAppTemplateData(jo,dc);
                    }
                    if(dxshAppIndustryChildMap.containsKey(dc.getChooseMinIndustryId())){
                        GetMyAllChannelRpVo.MinAppSubIndustry minAppSubIndustry = new GetMyAllChannelRpVo.MinAppSubIndustry();
                        DxshAppIndustryChild dxshAppIndustryChild = dxshAppIndustryChildMap.get(dc.getChooseMinIndustryId());
                        minAppSubIndustry.setId(dxshAppIndustryChild.getId());
                        minAppSubIndustry.setSubIndustryName(dxshAppIndustryChild.getSubIndustryName());
                        storesVo.setMinAppSubIndustry(minAppSubIndustry);
                    }
                    //设置商圈状态
                    if(dxshAppMinappInfoMap.containsKey(dc.getStoreId())){
                        storesVo.setGroupStatus(dxshAppMinappInfoMap.get(dc.getStoreId()).getStatus());
                    }
                    int countFinishNum = 0;
                    if(dc.getMinAppStatus() == Constants.MINAPP_FRONT_STATUS_CREATE_SUCCESS){
                        if(dc.getCollectionInfoStatus() == Constants.COMMON_FLAG_TRUE_INT){
                            countFinishNum ++;
                        }
                        if(dc.getMinappBaseInfoStatus() == Constants.COMMON_FLAG_TRUE_INT){
                            countFinishNum ++;
                        }
                        if(dc.getMinappManInfoStatus() == Constants.COMMON_FLAG_TRUE_INT){
                            countFinishNum ++;
                        }
                        storesVo.setMinAppCreateStep(countFinishNum);
                        int countTotalMinAppReleaseStep = 0;
                        if(dc.getCollectionInfoStatus() != Constants.COMMON_SECOND){
                            countTotalMinAppReleaseStep++;
                        }
                        if(dc.getMinappBaseInfoStatus() != Constants.COMMON_SECOND){
                            countTotalMinAppReleaseStep++;
                        }
                        if(dc.getMinappManInfoStatus() != Constants.COMMON_SECOND){
                            countTotalMinAppReleaseStep++;
                        }
                        storesVo.setTotalMinAppReleaseStep(countTotalMinAppReleaseStep);
                    }
                }


//                if(dc.getChannel() == DxshAppUserChannelService.CHANNEL_MDD){
//                    storesVo.setChannelName(gt.getVendorName());
//                } else if(dc.getChannel() == DxshAppUserChannelService.CHANNEL_MINAPP){
//                    if(StringUtils.isNotBlank(dc.getMinAppId())){
//                        dMap.put(dc.getId(),dc);
//                        minAppId.add(dc.getMinAppId());
//                    }
//                }
//                storesVo.setChannel(dc.getChannel());
//                storesVo.setId(dc.getId());
                //GetMyAllChannelRpVo.ChannelVo channelVo = BeanUtils.copyProperties(dc, GetMyAllChannelRpVo.ChannelVo.class);
                //sv.getChannels().add(channelVo);
                getMyStoreRpVo.getChannels().add(storesVo);
            }

            if(CollectionUtils.isNotEmpty(dxshAppUserChannels)){
                this.updateBatchById(dxshAppUserChannels);
            }
//            rpcResponseVo = businessAuthRestService.getUserClaimBusinessByBusinessId(businessId);
//            if (rpcResponseVo.isSuccess()) {
//                List<GetUserClaimBusinessRpDto> getUserClaimBusinessRpDto = new ArrayList<>();
//                GetUserClaimBusinessRpDto gt = rpcResponseVo.parseObject(GetUserClaimBusinessRpDto.class);
//                getUserClaimBusinessRpDto.add(gt);
//                if (CollectionUtils.isNotEmpty(getUserClaimBusinessRpDto)) {
//                    List<GetMyAllChannelRpVo.StoresVo> storesVos = new ArrayList<>();
//                    getUserClaimBusinessRpDto.forEach(gr -> {
//                        GetMyAllChannelRpVo.StoresVo storesVo = new GetMyAllChannelRpVo.StoresVo();
//                        storesVo.setChannelName(gr.getVendorName());
//                        storesVo.setLogoUrl(gr.getLogoUrl());
//                        storesVo.setAddr(String.format("%s-%s",gr.getAddrCity(),gr.getAddrDistrict()));
//                        storesVo.setLabelName(gr.getLabelName());
//                        storesVo.setTypeName(gr.getTypeName());
//                        storesVo.setBusinessId(gr.getBusinessId());
//                        if(StringUtils.isNotBlank(gr.getFontColor())) {
//                            storesVo.setFontColor(gr.getFontColor());
//                        }
//                        if(StringUtils.isNotBlank(gr.getBackColor())) {
//                            storesVo.setBackColor(gr.getBackColor());
//                        }
//                        storesVos.add(storesVo);
//                    });
//                    getMyStoreRpVo.setChannels(storesVos);
//                }
            //查出拥有这些店铺的渠道
//                List<DxshAppUserChannel> dxshAppUserChannels = this.getBusinssAllChannel(userId,businessId);
//                List<GetMyAllChannelRpVo.StoresVo> storesVos = getMyStoreRpVo.getChannels();
//                Set<Integer> updateMinAppStatus = new HashSet<>();
//                Map<Integer,DxshAppUserChannel> dMap = new HashMap<>();
//                Set<String> minAppId = new HashSet<>();
//                dxshAppUserChannels.forEach(dc -> {
//                    GetMyAllChannelRpVo.StoresVo storesVo = new GetMyAllChannelRpVo.StoresVo();
//                    BeanUtils.copyProperties(dc,storesVo);
//                    if(dc.getChannel() == DxshAppUserChannelService.CHANNEL_MDD){
//                        storesVo.setChannelName(gt.getVendorName());
//                    } else if(dc.getChannel() == DxshAppUserChannelService.CHANNEL_MINAPP){
//                        if(StringUtils.isNotBlank(dc.getMinAppId())){
//                            dMap.put(dc.getId(),dc);
//                            minAppId.add(dc.getMinAppId());
//                        }
//                    }
//                    storesVo.setChannel(dc.getChannel());
//                    storesVo.setId(dc.getId());
            //GetMyAllChannelRpVo.ChannelVo channelVo = BeanUtils.copyProperties(dc, GetMyAllChannelRpVo.ChannelVo.class);
            //sv.getChannels().add(channelVo);
//                    storesVos.add(storesVo);
//                });
//                if(minAppId.size() > 0){
//                    //获取
//                    Map<String,JSONObject> minAppData = this.getMinAppDataByIds(minAppId,userId,token);
//                    log.info("minAppData:{}",JSON.toJSONString(minAppData));
//                    storesVos.forEach(sv -> {
////                        List<GetMyAllChannelRpVo.ChannelVo> channelVos = sv.getChannels();
////                        if(CollectionUtils.isNotEmpty(channelVos)){
////                            channelVos.forEach(cv -> {
////
////                            });
////                        }
//                        if(sv.getChannel() == DxshAppUserChannelService.CHANNEL_MINAPP){
//                            if(minAppData.containsKey(sv.getMinAppId())){
//                                JSONObject minApp = minAppData.get(sv.getMinAppId());
//                                if(minApp.containsKey("status")){
//                                    sv.setAppStatus(minApp.getInteger("status"));
//                                    if(cv.getAppStatus() == Constants.MINAPP_STATUS_CREATE_FAIL){
//                                        updateMinAppStatus.add(cv.getId());
//                                        cv.setIsFill(Constants.COMMON_FLAG_FALSE_INT);
//                                        cv.setIsFinish(Constants.COMMON_FLAG_FALSE_INT);
//                                    }
        }
//                                if(minApp.containsKey("wxReleaseStep")){
//                                    cv.setWxReleaseStep(minApp.getInteger("wxReleaseStep"));
//                                }
//                                if(minApp.containsKey("wxReleaseStatus")){
//                                    cv.setWxReleaseStatus(minApp.getString("wxReleaseStatus"));
//                                }
//                                if(minApp.containsKey("name")){
//                                    sv.setChannelName(minApp.getString("name"));
//                                }
//                            }
//                        }
//                    });
//                }
        //postUpdateMinAppStatus(updateMinAppStatus,dMap);
        //调整这个逻辑
        //}
        //}
        return ResultMapHelper.success(getMyStoreRpVo,ResultMsg.MSG_GET_SUCCESS);
    }

    private void postHandleDcDataToStoresVo(DxshAppUserChannel dc, GetMyAllChannelRpVo.StoresVo storesVo) {
        BeanUtils.copyProperties(dc,storesVo);
        if(dc.getChannel() == DxshAppUserChannelService.CHANNEL_MINAPP) {
            if (StringUtils.isNotBlank(dc.getMinAppBodies())) {
                storesVo.setMinAppBodies(JSON.parseArray(dc.getMinAppBodies(), GetMyAllChannelRpVo.MinAppBody.class));
            }
        }
    }

    private void postHandleMinAppTemplateData(JSONObject jo, DxshAppUserChannel dc) {
        try {
            if (jo.containsKey("appDemoName")) {
                dc.setTemplateName(jo.getString("appDemoName"));
            }
            if (jo.containsKey("demoId")) {
                dc.setDemoId(jo.getString("demoId"));
            }
        }catch (Exception e){
            log.error(e.getMessage(),e);
        }
    }

    private List<GetMyAllChannelRpVo.MinAppBody> postHandleMinAppFastMenu(JSONObject jo,String token) {
        List<GetMyAllChannelRpVo.MinAppBody> minAppBodies = new ArrayList<>();
        try {
            String storeId = jo.getString("storeId");
            JSONArray jsonArray = jo.getJSONArray("featureList");
            if(jsonArray.size() > 0){
                for(int ii = 0;ii < jsonArray.size();ii++){
                    JSONObject feature = jsonArray.getJSONObject(ii);
                    GetMyAllChannelRpVo.MinAppBody minAppBody = new GetMyAllChannelRpVo.MinAppBody();
                    minAppBody.setName(feature.getString("name"));
                    minAppBody.setJumpUrl(String.format("%s&storeId=%s&userToken=%s",feature.getString("url"),storeId,token));
                    if(minAppFastPortMap.containsKey(minAppBody.getName())){
                        JSONObject jdata = minAppFastPortMap.get(minAppBody.getName());
                        minAppBody.setIcon(jdata.getString("icon"));
                        minAppBody.setJumpId(jdata.getInteger("jumpId"));
                    }else {
                        minAppBody.setIcon("http://dsp-1251624226.cos.ap-guangzhou.myqcloud.com/business/b202011251808186481C28.png");
                    }
                    minAppBodies.add(minAppBody);
                }
            }
        }catch (Exception e){
            log.error(e.getMessage(),e);
        }
        return minAppBodies;
    }

    private void postHandleMinAppManInfoStatus(JSONObject jo, DxshAppUserChannel dc) {
        if(jo.containsKey("setStoreInfo")){
            boolean setStoreInfo = jo.getBoolean("setStoreInfo");
            if(setStoreInfo){
                dc.setMinappManInfoStatus(Constants.COMMON_FLAG_TRUE_INT);
            }
        }

    }

    private void postHandleMinappBaseInfoStatus(JSONObject jsonObject, DxshAppUserChannel dc) {
        Integer status = jsonObject.getInteger("status");
        Integer wxReleaseStep = jsonObject.getInteger("wxReleaseStep");
        String wxReleaseStatus = jsonObject.getString("wxReleaseStatus");
        if(jsonObject.containsKey("status")
                && jsonObject.containsKey("wxReleaseStep") && jsonObject.containsKey("wxReleaseStatus")) {
            Set<Integer> wxReleaseSteps = new HashSet<>();
            wxReleaseSteps.add(Constants.MINAPP_WX_RELEASE_2);
            wxReleaseSteps.add(Constants.MINAPP_WX_RELEASE_3);
            wxReleaseSteps.add(Constants.MINAPP_WX_RELEASE_4);
            if (status.equals(Constants.MINAPP_STATUS_CREATE_ING)
                    && wxReleaseSteps.contains(wxReleaseStep) && wxReleaseStatus.equals("failure")) {
                dc.setMinappBaseInfoStatus(Constants.COMMON_FLAG_TRUE_INT_NO);
                dc.setMinappBaseInfoErrorStatus(wxReleaseStep);
            }
            //基础信息成功
            if (status.equals(Constants.MINAPP_STATUS_CREATE_ING) && wxReleaseStep == 7) {
                dc.setMinappBaseInfoStatus(Constants.COMMON_FLAG_TRUE_INT);
            }
        }
    }

    private void postHandleMinAppAuditStatus(JSONObject jsonObject, DxshAppUserChannel dc) {
        if(jsonObject.containsKey("wxReleaseStep")) {
            Integer wxReleaseStep = jsonObject.getInteger("wxReleaseStep");
            dc.setMinappAuditStatus(wxReleaseStep);
        }

    }

    private void postHanleMinAppStatus(JSONObject jsonObject,DxshAppUserChannel dxshAppUserChannel){
        if(jsonObject.containsKey("status") && jsonObject.get("status") != null){
            Integer status = jsonObject.getInteger("status");
            if(status.equals(Constants.MINAPP_STATUS_FIRST_CREATE_SUCCESS)){
                dxshAppUserChannel.setMinAppStatus(Constants.MINAPP_FRONT_STATUS_CREATE_SUCCESS);
            }else if(status.equals(Constants.MINAPP_STATUS_CREATE_FAIL)){
                dxshAppUserChannel.setMinAppStatus(Constants.MINAPP_FRONT_STATUS_CREATE_FAIL);
            }else if(status.equals(Constants.MINAPP_STATUS_QUAR_ERROR)){
                dxshAppUserChannel.setMinAppStatus(Constants.MINAPP_FRONT_STATUS_QU_ERROR);
            }else if(status.equals(Constants.MINAPP_STATUS_CREATE_SUCCESS)){
                dxshAppUserChannel.setMinAppStatus(Constants.MINAPP_FRONT_STATUS_RELEASE_SUCCESS);
            }
        }
    }

    @Override
    public Map<String, Object> getSubdividedIndustry(Integer userId) {
        Map<String,Object> resultMap = new HashMap<>();
        //查询用户是否选择行业
        DxshAppIndustry dxshAppIndustry = dxshAppIndustryChooseService.getUserChooseInIndustry(userId);
        Integer industryId = null;
        if(dxshAppIndustry == null){
            Integer businessId = dankMerchantsDefBusinessService.getChooseBusinessId(userId);
            if(businessId != null) {
                BankBusinessBo bankBusinessBo = dataBankBusinessService.getChooseBusinessData(businessId);
                if (bankBusinessBo != null) {
                    if (StringUtils.isNotBlank(bankBusinessBo.getTypeName())) {
                        if (BankBusinessController.industryTypeMap.containsKey(bankBusinessBo.getTypeName())) {
                            String industryName = BankBusinessController.industryTypeMap.get(bankBusinessBo.getTypeName());
                            dxshAppIndustry = dxshAppIndustryService.getIndustryByIndustryName(industryName);
                            if(dxshAppIndustry != null){
                                industryId = dxshAppIndustry.getId();
                            }
                        }
                    }

                }
            }
        }else {
            industryId = dxshAppIndustry.getId();
        }
        resultMap.put("isNoChoose",Constants.COMMON_FLAG_FALSE_INT);
        if(industryId == null){
            resultMap.put("isNoChoose",Constants.COMMON_FLAG_TRUE_INT);
            return ResultMapHelper.success(resultMap,ResultMsg.MSG_GET_SUCCESS);
        }
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq(DxshAppIndustryChild.INDUSTRY_ID,industryId);
        queryWrapper.eq(DxshAppIndustryChild.IS_DELETE,Constants.COMMON_FLAG_FALSE_INT);

        List<DxshAppIndustryChild> dxshAppIndustryChildrens = dxshAppIndustryChildService.list(queryWrapper);
        if(CollectionUtils.isEmpty(dxshAppIndustryChildrens)){
            resultMap.put("isNoChoose",Constants.COMMON_FLAG_TRUE_INT);
            return ResultMapHelper.success(resultMap,ResultMsg.MSG_GET_SUCCESS);
        }
        List<GetSubdividedIndustryRpVo> getSubdividedIndustryRpVos = BeanUtils.copyList(dxshAppIndustryChildrens,GetSubdividedIndustryRpVo.class);
        //        getSubdividedIndustryRpVos.add(new GetSubdividedIndustryRpVo(1,"咖啡厅"));
//        getSubdividedIndustryRpVos.add(new GetSubdividedIndustryRpVo(2,"西餐"));
//        getSubdividedIndustryRpVos.add(new GetSubdividedIndustryRpVo(3,"粤式"));
//        getSubdividedIndustryRpVos.add(new GetSubdividedIndustryRpVo(4,"面包甜点饮品"));
//        getSubdividedIndustryRpVos.add(new GetSubdividedIndustryRpVo(5,"川湘菜"));
//        getSubdividedIndustryRpVos.add(new GetSubdividedIndustryRpVo(6,"日韩料理"));
        resultMap.put("subdividedIndustrys",getSubdividedIndustryRpVos);
        return ResultMapHelper.success(resultMap,ResultMsg.MSG_GET_SUCCESS);
    }

    @Override
    public Map<String, Object> chooseSubdividedIndustry(GetMyChannelVo getMyChannelVo) {
        GetMyAllChannelRpVo.StoresVo storesVo = new GetMyAllChannelRpVo.StoresVo();
        DxshAppUserChannel dxshAppUserChannel = null;
        if(getMyChannelVo.getChannelId() != null){
            dxshAppUserChannel = dxshAppUserChannelMapper.selectById(getMyChannelVo.getChannelId());
        }
        //是否选择了一个默认的店铺
        Integer businessId = dankMerchantsDefBusinessService.getChooseBusinessId(getMyChannelVo.getUserId());

        //创建一个小程序渠道
        if(dxshAppUserChannel == null){
            dxshAppUserChannel = new DxshAppUserChannel();
            dxshAppUserChannel.setUserId(getMyChannelVo.getUserId());
            dxshAppUserChannel.setChannel(DxshAppUserChannelService.CHANNEL_MINAPP);
            dxshAppUserChannel.setNewTime(LocalDateTime.now());
            dxshAppUserChannelMapper.insert(dxshAppUserChannel);
        }
        dxshAppUserChannel.setChooseMinIndustryId(getMyChannelVo.getSubId());
        dxshAppUserChannel.setIsChooseMinIndustry(Constants.COMMON_FLAG_TRUE_INT);
        dxshAppUserChannel.setBusinessId(businessId);
        dxshAppUserChannelMapper.updateById(dxshAppUserChannel);
        Set<Integer> chooseMinIndustryIds = new HashSet<>();
        Map<Integer,DxshAppIndustryChild> dxshAppIndustryChildMap = new HashMap<>();
        if(chooseMinIndustryIds.size() > 0){
            dxshAppIndustryChildMap.putAll(dxshAppIndustryChildService.getMapByIds(chooseMinIndustryIds));
        }
        if(dxshAppIndustryChildMap.containsKey(dxshAppUserChannel.getChooseMinIndustryId())){
            GetMyAllChannelRpVo.MinAppSubIndustry minAppSubIndustry = new GetMyAllChannelRpVo.MinAppSubIndustry();
            DxshAppIndustryChild dxshAppIndustryChild = dxshAppIndustryChildMap.get(dxshAppUserChannel.getChooseMinIndustryId());
            minAppSubIndustry.setId(dxshAppIndustryChild.getId());
            minAppSubIndustry.setSubIndustryName(dxshAppIndustryChild.getSubIndustryName());
            storesVo.setMinAppSubIndustry(minAppSubIndustry);
        }
        BeanUtils.copyProperties(dxshAppUserChannel,storesVo);
        Map<String,Object> resultMap = new HashMap<>();
        resultMap.put("channel",storesVo);
        //保存一个细分行业类别
        ApplicationContextHolder.getApplicationContext().publishEvent(new MinAppUserChannelRecordEvent(
                "record",dxshAppUserChannel.getUserId(),"选择了细分行业",dxshAppUserChannel.getId()));
        return ResultMapHelper.success(resultMap,ResultMsg.HAND_SUCCESS);
    }

    @Override
    public Map<String, Object> readyOnIt(Integer channelId) {
        DxshAppUserChannel dxshAppUserChannel = dxshAppUserChannelMapper.selectById(channelId);
        if(dxshAppUserChannel != null){
            dxshAppUserChannel.setIsConfirmPreData(Constants.COMMON_FLAG_TRUE_INT);
            dxshAppUserChannelMapper.updateById(dxshAppUserChannel);
            ApplicationContextHolder.getApplicationContext().publishEvent(new MinAppUserChannelRecordEvent(
                    "record",dxshAppUserChannel.getUserId(),"点击了准备好了，开始申请",dxshAppUserChannel.getId()));
        }
        return ResultMapHelper.success(new HashMap<>(),ResultMsg.HAND_SUCCESS);
    }



    @Override
    public Map<String, Object> getAppDemoDetail(Integer userId,String demoId) {
        if(!getMinAppTemplListBoMap.containsKey(demoId)){
            BaseRqVo baseRqVo = new BaseRqVo();
            baseRqVo.setUserId(userId);
            getAppDemoList_v2(baseRqVo);
        }

        GetAppDemoDetailRpVo getAppDemoDetailRpVo = new GetAppDemoDetailRpVo();
//        getAppDemoDetailRpVo.setPicture("https://dsp-1251624226.cos.ap-guangzhou.myqcloud.com/dsp/20200716163816254.png");
//        getAppDemoDetailRpVo.setTitle("模板名称");
//        getAppDemoDetailRpVo.setPriceDesc("￥6890.99");


        GetAppDemoDetailRpVo.VersionChoose versionChoose = new GetAppDemoDetailRpVo.VersionChoose();
//        versionChoose.setId(1);
//        versionChoose.setVersionName("体验版");
//        getAppDemoDetailRpVo.getVersionChooseList().add(versionChoose);

        GetAppDemoDetailRpVo.TemplateDetails templateDetails = new GetAppDemoDetailRpVo.TemplateDetails();
//        templateDetails.setFunctionName("商品及订单");
//        templateDetails.setStandard(Constants.COMMON_FLAG_TRUE_INT);
//        templateDetails.setSenior(Constants.COMMON_FLAG_TRUE_INT);
//        getAppDemoDetailRpVo.getTemplateDetails().add(templateDetails);
//
//        templateDetails = new GetAppDemoDetailRpVo.TemplateDetails();
//        templateDetails.setFunctionName("会员");
//        templateDetails.setStandard(Constants.COMMON_FLAG_FALSE_INT);
//        templateDetails.setSenior(Constants.COMMON_FLAG_TRUE_INT);
//        getAppDemoDetailRpVo.getTemplateDetails().add(templateDetails);

        GetAppDemoDetailRpVo.ServicePlugIn servicePlugIn = new GetAppDemoDetailRpVo.ServicePlugIn();
        servicePlugIn.setServiceName("限时特价");
        servicePlugIn.setStandard(Constants.COMMON_FLAG_TRUE_INT);
        servicePlugIn.setSenior(Constants.COMMON_FLAG_TRUE_INT);
        getAppDemoDetailRpVo.getServicePlugIns().add(servicePlugIn);

        servicePlugIn = new GetAppDemoDetailRpVo.ServicePlugIn();
        servicePlugIn.setServiceName("详情页编辑");
        servicePlugIn.setStandard(Constants.COMMON_FLAG_FALSE_INT);
        servicePlugIn.setSenior(Constants.COMMON_FLAG_TRUE_INT);
        getAppDemoDetailRpVo.getServicePlugIns().add(servicePlugIn);

        //处理正式的逻辑
        GetMinAppTemplListBo getMinAppTemplListBo = getMinAppTemplListBoMap.get(demoId);
        getAppDemoDetailRpVo.setTitle(getMinAppTemplListBo.getName());
        getAppDemoDetailRpVo.setPriceDesc(getMinAppTemplListBo.getPrice());
        getAppDemoDetailRpVo.setServiceDesc("免费试用30天");
        getAppDemoDetailRpVo.setPreviewLink(getMinAppTemplListBo.getPreview());
        if(CollectionUtils.isNotEmpty(getMinAppTemplListBo.getServiceInfo())) {
            getAppDemoDetailRpVo.setPicture(getMinAppTemplListBo.getServiceInfo().get(0).getPreviewImgUrl());
        }
        Map<String,Map<String,Integer>> showMap = new HashMap<>();
        if(CollectionUtils.isNotEmpty(getMinAppTemplListBo.getServiceInfo())){
            if(CollectionUtils.isNotEmpty(getMinAppTemplListBo.getServiceInfo().get(0).getLevelList())){
                List<GetMinAppTemplListBo.LevelList> levelLists = getMinAppTemplListBo.getServiceInfo().get(0).getLevelList();
                for(GetMinAppTemplListBo.LevelList level : levelLists){
                    versionChoose = new GetAppDemoDetailRpVo.VersionChoose();
                    versionChoose.setId(level.getLevelId());
                    versionChoose.setVersionName(level.getLevelName());
                    getAppDemoDetailRpVo.getVersionChooseList().add(versionChoose);
                    if(CollectionUtils.isNotEmpty(level.getFeatureList())){
                        for(GetMinAppTemplListBo.FeatureList feature : level.getFeatureList()){
                            if(!showMap.containsKey(feature.getName())){
                                Map<String,Integer> values = new HashMap<>();
                                values.put("experienceEdition",Constants.COMMON_FLAG_FALSE_INT);
                                values.put("exclusiveEdition",Constants.COMMON_FLAG_FALSE_INT);
                                showMap.put(feature.getName(),values);
                            }
                            if(level.getLevelName().equals("体验版")){
                                showMap.get(feature.getName()).put("experienceEdition",Constants.COMMON_FLAG_TRUE_INT);
                            }else if(level.getLevelName().equals("尊享版")){
                                showMap.get(feature.getName()).put("exclusiveEdition",Constants.COMMON_FLAG_TRUE_INT);
                            }
                        }
                    }

                }
            }
        }

        if(showMap.size() > 0){
            for(Map.Entry<String,Map<String,Integer>> entry : showMap.entrySet()){
                templateDetails = new GetAppDemoDetailRpVo.TemplateDetails();
                templateDetails.setFunctionName(entry.getKey());
                templateDetails.setStandard(entry.getValue().get("experienceEdition"));
                templateDetails.setSenior(entry.getValue().get("exclusiveEdition"));
                getAppDemoDetailRpVo.getTemplateDetails().add(templateDetails);
            }
        }
        return ResultMapHelper.success(getAppDemoDetailRpVo,ResultMsg.MSG_GET_SUCCESS);
    }

    @Override
    public Map<String, Object> chooseMinAppDemo(Integer channelId, String demoId) {
        DxshAppUserChannel dxshAppUserChannel = dxshAppUserChannelMapper.selectById(channelId);
        dxshAppUserChannel.setIsChooseTemplate(Constants.COMMON_FLAG_TRUE_INT);
        if(getMinAppTemplListBoMap.containsKey(demoId)) {
            GetMinAppTemplListBo getMinAppTemplListBo = getMinAppTemplListBoMap.get(demoId);
            Map<String,Object> demoData = new HashMap<>();
            demoData.put("templateId",demoId);
            demoData.put("templateCodeId",getMinAppTemplListBo.getCodeId());
            demoData.put("templateCodeVersion",getMinAppTemplListBo.getVersion());
            dxshAppUserChannel.setChooseTemplateData(JSON.toJSONString(demoData));
            dxshAppUserChannel.setDemoId(demoId);
            dxshAppUserChannel.setTemplateName(getMinAppTemplListBo.getName());
        }
        dxshAppUserChannelMapper.updateById(dxshAppUserChannel);
        ApplicationContextHolder.getApplicationContext().publishEvent(new MinAppUserChannelRecordEvent(
                "record",dxshAppUserChannel.getUserId(),"选择了小程序模板",dxshAppUserChannel.getId()));
        return ResultMapHelper.success(new HashMap<>(),ResultMsg.HAND_SUCCESS);
    }

    @Override
    @Transactional
    public Map<String, Object> minAppCertification(CertificationBusinessVo certificationBusinessVo) {
        DxshAppUserChannel dxshAppUserChannel = dxshAppUserChannelMapper.selectById(certificationBusinessVo.getChannelId());
        if(dxshAppUserChannel == null){
            return ResultMapHelper.result(ResultCode.CODE_ERROR_100,ResultMsg.MSG_MIN_APP_CREATE_FAIL);
        }
        //保存资质信息
        DxshAppMinappAuth dxshAppMinappAuth = dxshAppMinappAuthService.getMinAppAuthByChannelId(certificationBusinessVo.getChannelId());
        if(dxshAppMinappAuth == null){
            dxshAppMinappAuth = new DxshAppMinappAuth();
            dxshAppMinappAuth.setChannelId(certificationBusinessVo.getChannelId());
            dxshAppMinappAuth.setUserId(certificationBusinessVo.getUserId());
            BeanUtils.copyProperties(certificationBusinessVo,dxshAppMinappAuth);
            dxshAppMinappAuthService.save(dxshAppMinappAuth);
        }else {
            BeanUtils.copyProperties(certificationBusinessVo,dxshAppMinappAuth);
            dxshAppMinappAuthService.updateById(dxshAppMinappAuth);
        }
        dxshAppUserChannel.setIsQualification(Constants.COMMON_FLAG_TRUE_INT);
        //将状态设置为等待创建小程序
        dxshAppUserChannel.setMinAppStatus(Constants.MINAPP_STATUS_WAIT_CREATE);
        //TODO
        //小程序开始第一段提交
        Map<String,Object> ret = this.firstCommitMinAppInfo(certificationBusinessVo,dxshAppUserChannel,dxshAppMinappAuth);
        if(!ResultMapHelper.isSuccess(ret)){
            return ResultMapHelper.result(ResultCode.CODE_ERROR_100,ret.get("msg").toString());
        }
        dxshAppUserChannelMapper.updateById(dxshAppUserChannel);
        ApplicationContextHolder.getApplicationContext().publishEvent(new MinAppUserChannelRecordEvent(
                "record",dxshAppUserChannel.getUserId(),"提交了小程序的资质信息",dxshAppUserChannel.getId()));
        Map<String,Object> resultMap = new HashMap<>();
        resultMap.put("minAppStatus",dxshAppUserChannel.getMinAppStatus());
        return ResultMapHelper.success(resultMap,ResultMsg.HAND_SUCCESS);
    }

    @Override
    public Map<String, Object> reSubmit(CertificationBusinessVo certificationBusinessVo) {
        DxshAppUserChannel dxshAppUserChannel = dxshAppUserChannelMapper.selectById(certificationBusinessVo.getChannelId());
        if(dxshAppUserChannel == null){
            return ResultMapHelper.result(ResultCode.CODE_ERROR_100,ResultMsg.MSG_MIN_APP_CREATE_FAIL);
        }
        //保存资质信息
        DxshAppMinappAuth dxshAppMinappAuth = dxshAppMinappAuthService.getMinAppAuthByChannelId(certificationBusinessVo.getChannelId());
        if(dxshAppMinappAuth == null){
            return ResultMapHelper.result(ResultCode.CODE_ERROR_100,ResultMsg.MSG_MIN_APP_CREATE_FAIL);
        }
        dxshAppUserChannel.setIsQualification(Constants.COMMON_FLAG_TRUE_INT);
        //将状态设置为等待创建小程序
        dxshAppUserChannel.setMinAppStatus(Constants.MINAPP_STATUS_WAIT_CREATE);
        dxshAppUserChannelMapper.updateById(dxshAppUserChannel);
        //TODO
        //小程序开始第一段提交
        Map<String,Object> ret = this.firstCommitMinAppInfo(certificationBusinessVo,dxshAppUserChannel,dxshAppMinappAuth);
        if(!ResultMapHelper.isSuccess(ret)){
            return ResultMapHelper.result(ResultCode.CODE_ERROR_100,ret.get("msg").toString());
        }
        Map<String,Object> resultMap = new HashMap<>();
        resultMap.put("minAppStatus",dxshAppUserChannel.getMinAppStatus());
        return ResultMapHelper.success(resultMap,ResultMsg.HAND_SUCCESS);
    }

    private Map<String,Object> firstCommitMinAppInfo(CertificationBusinessVo certificationBusinessVo
            ,DxshAppUserChannel dxshAppUserChannel,DxshAppMinappAuth dxshAppMinappAuth) {
        Map<String,Object> paramsMap = new HashMap<>();
        String chooseTemplateData = dxshAppUserChannel.getChooseTemplateData();
        if(StringUtils.isNotBlank(chooseTemplateData)){
            Map<String,Object> chooseTemplateDataMap = JSON.parseObject(chooseTemplateData);
            if(chooseTemplateDataMap.containsKey("templateId")){
                paramsMap.put("templateId",chooseTemplateDataMap.get("templateId").toString());
            }
            if(chooseTemplateDataMap.containsKey("templateCodeId")){
                paramsMap.put("templateCodeId",Integer.parseInt(chooseTemplateDataMap.get("templateCodeId").toString()));
            }
            if(chooseTemplateDataMap.containsKey("templateCodeVersion")){
                paramsMap.put("templateCodeVersion",chooseTemplateDataMap.get("templateCodeVersion").toString());
            }
        }
        Integer chooseMinIndustryId = dxshAppUserChannel.getChooseMinIndustryId();
        if(chooseMinIndustryId != null){
            DxshAppIndustryChild dxshAppIndustryChild = dxshAppIndustryChildService.getById(chooseMinIndustryId);
            if(dxshAppIndustryChild != null){
                paramsMap.put("firstCategoryId",dxshAppIndustryChild.getFirstItemId());
                paramsMap.put("secondCategoryId",dxshAppIndustryChild.getSecondItemId());
            }
        }
        paramsMap.put("companyName",dxshAppMinappAuth.getLicenseName());
        paramsMap.put("companyCode",dxshAppMinappAuth.getLicenseNo());
        paramsMap.put("companyLicense",dxshAppMinappAuth.getLicenseImg());
        paramsMap.put("legalPersonaWechat",dxshAppMinappAuth.getWechatAccount());
        paramsMap.put("legalPersonaName",dxshAppMinappAuth.getLegalPersonName());
        MerchantsUserInfoBo merchantsUserInfoBo = dataBankUserService.getMerchantsUserInfo(certificationBusinessVo.getUserId());
        if(merchantsUserInfoBo != null){
            paramsMap.put("componentPhone",merchantsUserInfoBo.getPhone());
        }
        try {
            //TODO 调取鸿杰那边的接口创建小程序
            String url = AppConfig.getProperty("saas.dxshapp.center.service") + "/dxshApp/app/createApp";
            String token = RequestHeaderData.getRequestHeaderData().getString("token");
            RpcResponseVo minrpcResponseVo = userRestService.getMiniTokenByUserId_v2(certificationBusinessVo.getUserId(),
                    token);
            if(!minrpcResponseVo.isSuccess()){
                log.info("获取小程序调用token失败：{}");
                return ResultMapHelper.failure(minrpcResponseVo.getMsg());
            }
            String minitoken = minrpcResponseVo.getData().toString();
            String requestBody = RestTemplateUtils.postForEntityForJsonByLoadBalanced(url,paramsMap,RestTemplateUtils.getSassHeader(minitoken));
            JSONObject userJson = JSON.parseObject(requestBody);
            if(userJson.containsKey("status")){
                if(ResultCode.CODE_NORMAL.equals(userJson.getString("status"))){
                    dxshAppUserChannel.setStoreId(userJson.getString("data"));
                    dxshAppUserChannel.setMinAppId(userJson.getString("data"));
                    dxshAppUserChannelMapper.updateById(dxshAppUserChannel);
                    return ResultMapHelper.success(ResultMsg.HAND_SUCCESS);
                }else{
                    if(userJson.getString("msg").equals("操作失败")){
                        return ResultMapHelper.failure(ResultMsg.MSG_MIN_APP_CREATE_ERROR);
                    }
                    return ResultMapHelper.failure(userJson.getString("msg"));
                }
            }
        }catch (Exception e){
            log.error(e.getMessage(),e);
        }
        return ResultMapHelper.failure(ResultMsg.HAND_FAIL);
    }

    @Override
    public Map<String, Object> readyOnItInfo(Integer userId,Integer channelId) {
        Map<String,Object> resultMap = new HashMap<>();
        resultMap.put("documentDescription",new ArrayList<>());
        resultMap.put("options","");
        resultMap.put("example",new ArrayList<>());
        DxshAppUserChannel dxshAppUserChannel = dxshAppUserChannelMapper.selectById(channelId);
        if(dxshAppUserChannel == null){
            return ResultMapHelper.result(ResultCode.CODE_ERROR_100,ResultMsg.MSG_MIN_APP_CREATE_FAIL);
        }
        Integer minIndustryId = dxshAppUserChannel.getChooseMinIndustryId();
        if(minIndustryId == null){
            return ResultMapHelper.result(ResultCode.CODE_ERROR_100,ResultMsg.MSG_MIN_APP_CREATE_FAIL);
        }
        DxshAppIndustryChild dxshAppIndustryChild = dxshAppIndustryChildService.getById(minIndustryId);
        if(dxshAppIndustryChild != null){
            String qualRequirements = dxshAppIndustryChild.getQualRequirementsDesc();
            String options = dxshAppIndustryChild.getOptions();
            if(StringUtils.isNotBlank(options)) {
                resultMap.put("options", options);
            }
            if(StringUtils.isNotBlank(qualRequirements)){
                List<String> qualRequirementArray = JSONObject.parseArray(qualRequirements,String.class);
                if(CollectionUtils.isNotEmpty(qualRequirementArray)){
                    resultMap.put("documentDescription",qualRequirementArray);
                }
            }
            if(StringUtils.isNotBlank(dxshAppIndustryChild.getQualExample())){
                resultMap.put("example",JSON.parseArray(dxshAppIndustryChild.getQualExample()));
            }
        }
        return ResultMapHelper.success(resultMap,ResultMsg.MSG_GET_SUCCESS);
    }

    @Override
    public Map<String, Object> releaseMinAppPrepare(Integer channelId) {
        DxshAppUserChannel dxshAppUserChannel = dxshAppUserChannelMapper.selectById(channelId);
        if(dxshAppUserChannel == null){
            return ResultMapHelper.result(ResultCode.CODE_ERROR_100,ResultMsg.MSG_MIN_APP_CREATE_FAIL);
        }
        ReleaseMinAppPrepareRpVo releaseMinAppPrepareRpVo = new ReleaseMinAppPrepareRpVo();
        releaseMinAppPrepareRpVo.setCollectionInfoStatus(dxshAppUserChannel.getCollectionInfoStatus());
        releaseMinAppPrepareRpVo.setMinappBaseInfoStatus(dxshAppUserChannel.getMinappBaseInfoStatus());
        releaseMinAppPrepareRpVo.setMinappBaseInfoErrorStatus(dxshAppUserChannel.getMinappBaseInfoErrorStatus());
        releaseMinAppPrepareRpVo.setMinappManInfoStatus(dxshAppUserChannel.getMinappManInfoStatus());
        releaseMinAppPrepareRpVo.setCollectionInfoQrCode(dxshAppUserChannel.getSignCode());
        return ResultMapHelper.success(releaseMinAppPrepareRpVo,ResultMsg.MSG_GET_SUCCESS);
    }

    @Override
    public Map<String, Object> getMinAppInfo_v2(MinAppInfoVo minAppInfoVo) {
        Integer channelId = minAppInfoVo.getChannelId();
        DxshAppUserChannel dxshAppUserChannel = dxshAppUserChannelMapper.selectById(channelId);
        if(dxshAppUserChannel == null){
            return ResultMapHelper.result(ResultCode.CODE_ERROR_100,ResultMsg.MSG_MIN_APP_CREATE_FAIL);
        }
        GetMinAppInfoV2RpVo getMinAppInfoV2RpVo = new GetMinAppInfoV2RpVo();
        DxshAppMinappAuth dxshAppMinappAuth = dxshAppMinappAuthService.getMinAppAuthByChannelId(channelId);
        DxshAppIndustryChild dxshAppIndustryChild = dxshAppIndustryChildService.getById(dxshAppUserChannel.getChooseMinIndustryId());
        getMinAppInfoV2RpVo.setMinAppBaseInfoErrorStatus(dxshAppUserChannel.getMinappBaseInfoErrorStatus());
        if(dxshAppMinappAuth != null){
            getMinAppInfoV2RpVo.setMinName(dxshAppMinappAuth.getMinName());
            getMinAppInfoV2RpVo.setMinHeadImg(dxshAppMinappAuth.getMinHeadImg());
            getMinAppInfoV2RpVo.setMinIntroduce(dxshAppMinappAuth.getMinIntroduce());
        }
        getMinAppInfoV2RpVo.setCompanyCertificates(new ArrayList<>());
        if(StringUtils.isNotBlank(dxshAppMinappAuth.getCompanyCertificates())){
            getMinAppInfoV2RpVo.setCompanyCertificates(JSON.parseArray(dxshAppMinappAuth.getCompanyCertificates(),String.class));
        }
        if(dxshAppIndustryChild != null && StringUtils.isNotBlank(dxshAppIndustryChild.getQualRequirementsDesc())){
            getMinAppInfoV2RpVo.setCompanyCertificatesDesc(JSON.parseArray(dxshAppIndustryChild.getQualRequirementsDesc(),String.class));
        }
        return ResultMapHelper.success(getMinAppInfoV2RpVo,ResultMsg.MSG_GET_SUCCESS);
    }

    @Override
    public Map<String, Object> getAppCollectionInfo(MinExclusiveInfoVo minExclusiveInfoVo) {
        Integer channelId = minExclusiveInfoVo.getChannelId();
        DxshAppUserChannel dxshAppUserChannel = dxshAppUserChannelMapper.selectById(channelId);
        if(dxshAppUserChannel == null){
            return ResultMapHelper.result(ResultCode.CODE_ERROR_100,ResultMsg.MSG_MIN_APP_CREATE_FAIL);
        }
        DxshAppMinappAuth dxshAppMinappAuth = dxshAppMinappAuthService.getMinAppAuthByChannelId(channelId);
        if(dxshAppMinappAuth == null){
            return ResultMapHelper.result(ResultCode.CODE_ERROR_100,ResultMsg.MSG_MIN_APP_CREATE_FAIL);
        }
        GetAppCollectionInfoRpVo rpVo = new GetAppCollectionInfoRpVo();
        BeanUtils.copyProperties(dxshAppUserChannel,rpVo,BeanUtils.getNullPropertyNames(dxshAppUserChannel));
        BeanUtils.copyProperties(dxshAppMinappAuth,rpVo,BeanUtils.getNullPropertyNames(dxshAppMinappAuth));
        return ResultMapHelper.success(rpVo,ResultMsg.MSG_GET_FAIL);
    }


    @Override
    public Map<String, Object> minAppShare(Integer channelId) {
        final String TMP_IMG = "/minAppShare.png";
        Map<String,Object> resultMap = new HashMap<>();
        DxshAppUserChannel dxshAppUserChannel = dxshAppUserChannelMapper.selectById(channelId);
        if(dxshAppUserChannel == null){
            return ResultMapHelper.result(ResultCode.CODE_ERROR_100,ResultMsg.MSG_MIN_APP_CREATE_FAIL);
        }
        if(StringUtils.isNotBlank(dxshAppUserChannel.getMinappQrcode())){
            resultMap.put("qrCode",dxshAppUserChannel.getMinappQrcode());
            return ResultMapHelper.success(resultMap,ResultMsg.MSG_GET_SUCCESS);
        }
        String url = AppConfig.getProperty("saas.dxshapp.common.center.service") + "/wx/mini/getQrCode";
        String token = RequestHeaderData.getRequestHeaderData().getString("token");
        RpcResponseVo minrpcResponseVo = userRestService.getMiniTokenByUserId_v2(dxshAppUserChannel.getUserId(),
                token);
        if(!minrpcResponseVo.isSuccess()){
            log.info("获取小程序调用token失败：{}");
            return ResultMapHelper.success(resultMap,ResultMsg.MSG_GET_SUCCESS);
        }
        Map<String,Object> paramsMap = new LinkedHashMap<>();
        paramsMap.put("appid",dxshAppUserChannel.getAppid());
        paramsMap.put("scene","A=1");
        String minitoken = minrpcResponseVo.getData().toString();
        String requestBody = RestTemplateUtils.postForEntityForJsonByLoadBalanced(url,paramsMap,RestTemplateUtils.getSassHeader(minitoken));
        JSONObject userJson = JSON.parseObject(requestBody);
        if(userJson.containsKey("code") && userJson.getString("code").equals("success")){
//        StringBuilder sb = new StringBuilder();
//        sb.append("");
//        sb.append("fYXbT9T1m1QkHFlbxwxQTLwrK5yWzX7P4IqrhuJcbm+FowxGZYLLpYLJKE7clTO85qwwGCc1dP2VCjLF4uvP7FDD1Zen8s/Sv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7Jf8AwUK+G2ofFX9kn4u6P8VPC2h6pFofiaO2stW0TxB4T1ua2F5DpXibw5r1jp2saTdXFqftFo89r9lvYA01lc3ESs4/kM/4PgbLxqfhT+wRqNvqDJ8Oo/iD8ZrHVtLF2irceNJ/Dng648P37WWzzJTa6HbeJYFut4SD7W0RQtOrL8cf8GSHxK/sv9qj9sv4TXGv3UEPjH4FeDfG2neGQkz2Wo33gjxyNJvdZZ0haCG60uy8ZRWkfnTRPNFqcgiSXynMQB/pA0UUUAU9Q07T9XsrjTdVsLLU9OvImhu7DULWC9srqFxh4ri1uY5YJ4mHDRyxsrDgg1La2trY28NnZW1vZ2lvGsVva2sMdvbwRLwscMESpFFGo4VEVVHYVPRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAfwB/8ABb3/AINiP20f2s/+ChPxD/aj/Y9k+FevfDz9ofVNB8Q+M9N8Z+O5PCes+APGseh2GkeKNUvYNRsLxdV8O6tNpiaxatoc95fW9zeXFh/ZEEEds8n9hv8AwTK/Yzt/+Cfv7Cv7On7JK6tZ+INW+E3gdbPxbr+nG8Oma3451/U9Q8UeNdT0tb/bdJpdz4m1rUzpqSxW7CxWAta2zFoU+76KACiiigD8Ef8Ag4X/AOCUPj7/AIKv/sd+Fvh78F9X8L6R8c/g78SIfiP8O18Z6ne6P4c1+1vNF1DQPFXhW71O1tr6LTrrVrK5srrTL+8sZbaG+0uGCe4srW6ubgfnh/wbSf8ABBv9ov8A4JlfED41/tJftdSeB9M+Jvj/AMB6f8Lvh/4I8GeKH8VzeHfDM+u2viLxXqviPVLGC30M3mrXmi+HLbTrKzm1R7eC0vJZp7V5Vjk/r9ooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooA//Z");
//        String imageData = sb.toString();
            String[] imgDatas = userJson.getString("image").split("data:image/png;base64,");
            if(imgDatas.length > 1) {
                if (CDNUtils.generateImage(imgDatas[1], tmpDirectory + TMP_IMG)) {
                    //将图片上传到cdn
                    BmsCdnData bmsCdnData = CDNUtils.uploadCOS(CDNUtils.bucketName, "/minAppShare/", tmpDirectory + TMP_IMG, CDNUtils.width, CDNUtils.height);
                    if (bmsCdnData != null) {
                        dxshAppUserChannel.setMinappQrcode(bmsCdnData.getSourceUrlBig());
                        dxshAppUserChannelMapper.updateById(dxshAppUserChannel);
                    }
                    resultMap.put("qrCode", dxshAppUserChannel.getMinappQrcode());
                    return ResultMapHelper.success(resultMap, ResultMsg.MSG_GET_SUCCESS);
                }
            }
        }
        return ResultMapHelper.result(ResultCode.CODE_ERROR_100,"二维码获取失败，请稍后重试");
    }

    @Override
    public DxshAppUserChannel getByStoreId(String storeId) {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq(DxshAppUserChannel.STORE_ID,storeId);
        List<DxshAppUserChannel> dxshAppUserChannels = dxshAppUserChannelMapper.selectList(queryWrapper);
        if(CollectionUtils.isNotEmpty(dxshAppUserChannels)){
            return dxshAppUserChannels.get(0);
        }
        return null;
    }

    @Override
    public DxshAppUserChannel getByAppId(String appid) {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq(DxshAppUserChannel.APP_ID,appid);
        List<DxshAppUserChannel> dxshAppUserChannels = dxshAppUserChannelMapper.selectList(queryWrapper);
        if(CollectionUtils.isNotEmpty(dxshAppUserChannels)){
            return dxshAppUserChannels.get(0);
        }
        return null;
    }

    @Override
    public void postHandleMinAppNews(MinAppNewsBo minAppNewsBo, String storeId) {
        DxshAppUserChannel dxshAppUserChannel = this.getByStoreId(storeId);
        if(dxshAppUserChannel != null){
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("status",minAppNewsBo.getAppStatus());
            jsonObject.put("wxReleaseStep",minAppNewsBo.getWxReleaseStep());
            jsonObject.put("wxReleaseStatus",minAppNewsBo.getWxReleaseStatus());
            postHanleMinAppStatus(jsonObject,dxshAppUserChannel);
            postHandleMinappBaseInfoStatus(jsonObject,dxshAppUserChannel);
            dxshAppUserChannelMapper.updateById(dxshAppUserChannel);
        }
    }

    private void syncMddForDankData(List<GetUserClaimBusinessRpDto> getUserClaimBusinessRpDtos) {
        if(CollectionUtils.isNotEmpty(getUserClaimBusinessRpDtos)){
            for(GetUserClaimBusinessRpDto getUserClaimBusinessRpDto : getUserClaimBusinessRpDtos){
                if(getUserClaimBusinessRpDto.getBusinessId() != null){
                    Integer businessAuthId = getUserClaimBusinessRpDto.getId();
                }

            }
        }
    }

    public void postUpdateMinAppStatus(Set<Integer> ids, Map<Integer,DxshAppUserChannel> dxshAppUserChannelMap) {
        if(ids.size() > 0) {
            if (dxshAppUserChannelMap == null) {
                dxshAppUserChannelMap = this.findByIds(ids);
            }
            if (dxshAppUserChannelMap.size() > 0) {
                List<DxshAppUserChannel> dxshAppUserChannels = new ArrayList<>();
                for(Integer id : ids){
                    if (dxshAppUserChannelMap.containsKey(id)) {
                        DxshAppUserChannel dxshAppUserChannel = dxshAppUserChannelMap.get(id);
                        dxshAppUserChannel.setIsFill(Constants.COMMON_FLAG_FALSE_INT);
                        dxshAppUserChannel.setIsFinish(Constants.COMMON_FLAG_FALSE_INT);
                        dxshAppUserChannels.add(dxshAppUserChannel);
                    }
                }
                if (dxshAppUserChannels.size() > 0) {
                    this.updateBatchById(dxshAppUserChannels);
                }
            }
        }
    }

    private Map<Integer, DxshAppUserChannel> findByIds(Set<Integer> ids) {
        Map<Integer, DxshAppUserChannel> dxshAppUserChannelMap = new HashMap<>();
        if(ids.size() > 0){
            QueryWrapper queryWrapper = new QueryWrapper();
            queryWrapper.in(DxshAppUserChannel.ID,ids);
            List<DxshAppUserChannel> dxshAppUserChannels = dxshAppUserChannelMapper.selectList(queryWrapper);
            if(CollectionUtils.isNotEmpty(dxshAppUserChannels)){
                dxshAppUserChannels.forEach(dx -> {
                    dxshAppUserChannelMap.put(dx.getId(),dx);
                });
            }
        }
        return dxshAppUserChannelMap;
    }


    private Map<String,JSONObject> getMinAppDataByIds(Set<String> minAppIds,Integer userId,String token) {
        Map<String,JSONObject> minAppData = new HashMap<>();
        if(ApplicationContextHolder.checkRunProfile("dev")){
           return minAppData;
        }
        try {
            String postUrl = AppConfig.getProperty("saas.dxshapp.center.service") + "/dxshApp/app/getByStoreIds";
            RpcResponseVo rpcResponseVo = userRestService.getMiniTokenByUserId_v2(userId,token);
            log.info("rpcResponseVo : {}",rpcResponseVo.toString());
            if(rpcResponseVo.isSuccess()){
                String minitoken = rpcResponseVo.getData().toString();
                String reponseBody = RestTemplateUtils.postForEntityForJsonByLoadBalanced(postUrl,minAppIds,RestTemplateUtils.getSassHeader(minitoken));
                if(StringUtils.isNotBlank(reponseBody)){
                    JSONObject reponseResult = JSON.parseObject(reponseBody);
                    for(String minAppId : minAppIds){
                        if(reponseResult.containsKey("status") && ResultCode.CODE_NORMAL.equals(reponseResult.getString("status"))){
                            JSONObject jsonObject = reponseResult.getJSONObject("data");
                            if(jsonObject.containsKey(minAppId)) {
                                minAppData.put(minAppId, jsonObject.getJSONObject(minAppId));
                            }
                        }
                    }
                }
            }
        }catch (Exception e){
            log.error(e.getMessage(),e);
        }
        return minAppData;
    }

    @Override
    public Map<Integer, List<DxshAppUserChannel>> getBusinssAllChannel(Integer userId) {
        Map<Integer,List<DxshAppUserChannel>> dxshAppUserChannelMap = new HashMap<>();
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq(DxshAppUserChannel.USER_ID,userId);
        List<DxshAppUserChannel> dxshAppUserChannels = dxshAppUserChannelMapper.selectList(queryWrapper);
        if(CollectionUtils.isNotEmpty(dxshAppUserChannels)){
            dxshAppUserChannels.forEach(dx -> {
                if(!dxshAppUserChannelMap.containsKey(dx.getBusinessId())){
                    dxshAppUserChannelMap.put(dx.getBusinessId(),new ArrayList<>());
                }
                dxshAppUserChannelMap.get(dx.getBusinessId()).add(dx);
            });
        }
        return dxshAppUserChannelMap;
    }

    public List<DxshAppUserChannel> getUserAllChannel(Integer userId) {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.orderByDesc(DxshAppUserChannel.NEW_TIME);
        queryWrapper.eq(DxshAppUserChannel.USER_ID,userId);
        List<DxshAppUserChannel> dxshAppUserChannels = dxshAppUserChannelMapper.selectList(queryWrapper);
        return dxshAppUserChannels;
    }

    public List<DxshAppUserChannel> getBusinssAllChannel(Integer userId,Integer businessId) {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq(DxshAppUserChannel.USER_ID,userId);
        queryWrapper.eq(DxshAppUserChannel.BUSINESS_ID,businessId);
        return dxshAppUserChannelMapper.selectList(queryWrapper);
    }

    @Override
    public Map<String, Object> addChannel(Integer userId,Integer businessId,Integer channel) {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq(DxshAppUserChannel.USER_ID,userId);
        queryWrapper.eq(DxshAppUserChannel.BUSINESS_ID,businessId);
        queryWrapper.eq(DxshAppUserChannel.CHANNEL,channel);
        List<DxshAppUserChannel> dxshAppUserChannels = dxshAppUserChannelMapper.selectList(queryWrapper);
        if(!CollectionUtils.isNotEmpty(dxshAppUserChannels)){
            DxshAppUserChannel dxshAppUserChannel = new DxshAppUserChannel();
            dxshAppUserChannel.setChannel(channel);
            dxshAppUserChannel.setUserId(userId);
            dxshAppUserChannel.setBusinessId(businessId);
            dxshAppUserChannel.setIsFill(DxshAppUserChannelService.IS_FILL_CODE_4);
            if(dxshAppUserChannel.getChannel() == DxshAppUserChannelService.CHANNEL_MINAPP){
                dxshAppUserChannel.setIsFill(Constants.COMMON_FLAG_FALSE_INT);
            }
            dxshAppUserChannelMapper.insert(dxshAppUserChannel);
            dxshAppUserChannels.add(dxshAppUserChannel);
        }
        DxshAppUserChannel dxshAppUserChannel = dxshAppUserChannels.get(0);
        GetMyStoreRpVo.ChannelVo channelVo = BeanUtils.copyProperties(dxshAppUserChannel, GetMyStoreRpVo.ChannelVo.class);
        return ResultMapHelper.success(channelVo,ResultMsg.MSG_GET_SUCCESS);
    }

    @Override
    public RpcResponseVo transferManager(Integer userId, Integer newManagerId, Integer businessId, Integer channel) {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq(DxshAppUserChannel.USER_ID,userId);
        queryWrapper.eq(DxshAppUserChannel.BUSINESS_ID,businessId);
        queryWrapper.eq(DxshAppUserChannel.CHANNEL,channel);
        List<DxshAppUserChannel> dxshAppUserChannels = dxshAppUserChannelMapper.selectList(queryWrapper);
        if(CollectionUtils.isNotEmpty(dxshAppUserChannels)){
            DxshAppUserChannel dxshAppUserChannel = dxshAppUserChannels.get(0);
            dxshAppUserChannel.setUserId(newManagerId);
            dxshAppUserChannelMapper.updateById(dxshAppUserChannel);
        }
        return RpcResponseVo.success(null);
    }

    @Override
    @GlobalTransactional(rollbackFor = Exception.class)
    public RpcResponseVo administratorReleaseBusiness(Integer userId,Integer businessId,List<Integer> assistantIds) {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq(DxshAppUserChannel.USER_ID,userId);
        queryWrapper.eq(DxshAppUserChannel.BUSINESS_ID,businessId);
        List<DxshAppUserChannel> dxshAppUserChannels = dxshAppUserChannelMapper.selectList(queryWrapper);
        if(CollectionUtils.isNotEmpty(dxshAppUserChannels)) {
            for (DxshAppUserChannel dxshAppUserChannel : dxshAppUserChannels) {
                if (dxshAppUserChannel.getChannel() == DxshAppUserChannelService.CHANNEL_MINAPP) {
                    //删除小程序数据
                    dxshAppMinappAuthService.deleteChannelData(dxshAppUserChannel.getId());
                }
                dxshAppUserChannelMapper.deleteById(dxshAppUserChannel.getId());
            }
        }
        //判断用户是否还有店
        String assistantIdsArray = JSON.toJSONString(assistantIds);
        userRestService.forceBusinessUserLogout(userId.toString(),businessId,assistantIdsArray);
        return RpcResponseVo.success(null);
    }

    @Override
    public Map<String, Object> mddCertification(CertificationBusinessVo certificationBusinessVo) {
        CertificationBusinessDto certificationBusinessDto = BeanUtils.copyProperties(certificationBusinessVo, CertificationBusinessDto.class);
        log.info("certificationBusinessDto:" + JSON.toJSONString(certificationBusinessDto));
        //先查询这个用户提交过资质信息没有
        RpcResponseVo rpcResponseVo = null;
        DxshAppUserChannel dxshAppUserChannel = null;
        if(certificationBusinessVo.getChannelId() == null){
            QueryWrapper queryWrapper = new QueryWrapper();
            queryWrapper.eq(DxshAppUserChannel.USER_ID,certificationBusinessVo.getUserId());
            queryWrapper.eq(DxshAppUserChannel.CHANNEL, DxshAppUserChannelService.CHANNEL_MDD);
            if(dxshAppUserChannelMapper.selectCount(queryWrapper) > 0){
                return ResultMapHelper.result(ResultCode.CODE_ERROR_100, ResultMsg.MSG_ALREADY_MDD);
            }
        }
        if(certificationBusinessVo.getChannelId() != null){
            dxshAppUserChannel = dxshAppUserChannelMapper.selectById(certificationBusinessVo.getChannelId());
            if(dxshAppUserChannel != null && dxshAppUserChannel.getBusinessAuthId() != null){
                certificationBusinessDto.setBusinessAuthId(dxshAppUserChannel.getBusinessAuthId());
            }
        }
        rpcResponseVo = businessRestService.mddCertification(certificationBusinessDto);
        if (rpcResponseVo.isSuccess()) {
            //添加一条渠道
            certificationBusinessDto = rpcResponseVo.parseObject(CertificationBusinessDto.class);
            if (dxshAppUserChannel == null){
                dxshAppUserChannel = this.mddAddUserChannel(certificationBusinessVo.getUserId(), DxshAppUserChannelService.CHANNEL_MDD, certificationBusinessDto.getBusinessAuthId());
            }
            if(dxshAppUserChannel == null){
                return ResultMapHelper.result(ResultCode.CODE_ERROR_100, ResultMsg.MSG_CLAIM_FAIL);
            }
            dxshAppUserChannel.setIsQualification(Constants.COMMON_FLAG_TRUE_INT);
//            DxshAppUserChannel dxshAppUserChannel = this.addUserChannel(certificationBusinessVo.getUserId(), certificationBusinessVo.getBusinessId(),
//                    certificationBusinessVo.getChannel(), certificationBusinessDto.getBusinessAuthId());
//            if (certificationBusinessDto.getChannel() == DxshAppUserChannelService.CHANNEL_MINAPP) {
//                if (dxshAppUserChannel != null) {
//                    dxshAppMinappAuth.setChannelId(dxshAppUserChannel.getId());
//                    dxshAppMinappAuthService.saveOrUpdate(dxshAppMinappAuth);
//                    dxshAppUserChannel.setBusinessAuthId(dxshAppMinappAuth.getId());
//
//                    if (dxshAppUserChannel.getIsFill() == Constants.COMMON_FLAG_TRUE_INT) {
//                        //修改资质异常调用小程序接口
//                        boolean flag = modifyQualificationInfo(dxshAppUserChannel, dxshAppMinappAuth);
//                        if (!flag) {
//                            throw new SystemErrorException("小程序修改资质失败");
//                        }
//                    }
//
//                }
//            }
//            pushChannelBankInfo(dxshAppUserChannel, certificationBusinessDto);
            log.info("--------------->资质是否完整  isFinish " + certificationBusinessDto.getIsFinished() + "<--------------");
            pushIsFinish(dxshAppUserChannel, certificationBusinessDto);
            this.updateById(dxshAppUserChannel);
            MddCertificationRpVo mddCertificationRpVo = new MddCertificationRpVo();
            BeanUtils.copyProperties(dxshAppUserChannel,mddCertificationRpVo);
            mddCertificationRpVo.setChannelName(certificationBusinessDto.getVendorName());
            if(dxshAppUserChannel.getBusinessId() != null) {
                mddCertificationRpVo.setNewNums(dxshAppNewsService.countByMddNoReadMessage(dxshAppUserChannel.getBusinessId()));
            }
            return ResultMapHelper.success(mddCertificationRpVo, ResultMsg.HAND_SUCCESS);
        }
        return ResultMapHelper.result(ResultCode.CODE_ERROR_100, rpcResponseVo.getMsg());
    }





    @Override
    public Map<String, Object> getMinAppRevDataByStoreId(String storeId,String appId) {
        String callToken = "";
        String minitoken = "";
        int DEFAULT_USER_ID = 233;
        log.info("storeId:{}",storeId);
        log.info("appId:{}",appId);
        try {
            if(StringUtils.isBlank(storeId) && StringUtils.isNotBlank(appId)){
                callToken = getCalltoken(DEFAULT_USER_ID);
                log.info("callToken : {}",callToken);
                minitoken = getMinitoken(DEFAULT_USER_ID,callToken);
                log.info("minitoken : {}",minitoken);
                String url = AppConfig.getProperty("saas.dxshapp.store.center.service") + "/sys/applet/getByAppId";
                Map<String,Object> paramsMap = new HashMap<>();
                paramsMap.put("appid",appId);
                String responseBody = RestTemplateUtils.getForEntity(RestTemplateUtils.getLoadRestTemplate(),url,paramsMap,RestTemplateUtils.getSassHeader(minitoken));
                log.info("getByAppId ： {}",responseBody);
                Map<String,Object> resultMap = (Map)JSON.parse(responseBody);
                if(resultMap.get("code") != null && resultMap.get("code").toString().equals("200")){
                    Map<String,Object> dataMap = (Map) resultMap.get("data");
                    storeId = String.valueOf(dataMap.get("storeId"));
                }
            }
        }catch (Exception e){
            log.error(e.getMessage(),e);
        }
        GetMinAppRevDataByStoreIdRpVo getMinAppRevDataByStoreIdRpVo = new GetMinAppRevDataByStoreIdRpVo();
        if(StringUtils.isNotBlank(storeId)) {
            QueryWrapper queryWrapper = new QueryWrapper();
            queryWrapper.eq(DxshAppUserChannel.MIN_APP_ID, storeId);
            List<DxshAppUserChannel> dxshAppUserChannels = dxshAppUserChannelMapper.selectList(queryWrapper);
            if (CollectionUtils.isEmpty(dxshAppUserChannels)) {
                return ResultMapHelper.result(ResultCode.CODE_ERROR_05, ResultMsg.CODE_ERROR_05);
            }
            DxshAppUserChannel dxshAppUserChannel = dxshAppUserChannels.get(0);
            String merchantsAccountId = null;
        /*try {
            RpcResponseVo rpcResponseVo = userMerchantsRelationRestService.getMerchantsAccountIdByUserId(dxshAppUserChannel.getUserId());
            if(rpcResponseVo.isSuccess()){
                merchantsAccountId = rpcResponseVo.getDataElement("merchantsAccountId").toString();
                rpcResponseVo = syniMerchantsAccountRestService.getMerchantsByAccountId(merchantsAccountId);
                if(rpcResponseVo.isSuccess()){
                    MerchantsUserInfoBo merchantsUserInfoBo = rpcResponseVo.parseObject(MerchantsUserInfoBo.class);
                    getMinAppRevDataByStoreIdRpVo.setNickName(merchantsUserInfoBo.getSurName() + merchantsUserInfoBo.getName());
                    getMinAppRevDataByStoreIdRpVo.setPhone(merchantsUserInfoBo.getPhone());
                    getMinAppRevDataByStoreIdRpVo.setNewTime(merchantsUserInfoBo.getNewTime());
                    getMinAppRevDataByStoreIdRpVo.setHeadImg(merchantsUserInfoBo.getHeadImg());
                }
            }
        }catch (Exception e){
            log.error(e.getMessage(),e);
        }*/
            if (merchantsAccountId == null) {
                //查询老数据
                queryWrapper.clear();
                queryWrapper.eq(DxshAppUserInfo.USER_ID, dxshAppUserChannel.getUserId());
                List<DxshAppUserInfo> dxshAppUserInfos = dxshAppUserInfoService.list(queryWrapper);
                if (CollectionUtils.isNotEmpty(dxshAppUserInfos)) {
                    DxshAppUserInfo dxshAppUserInfo = dxshAppUserInfos.get(0);
                    getMinAppRevDataByStoreIdRpVo.setNickName(dxshAppUserInfo.getSurName() + dxshAppUserInfo.getName());
                    getMinAppRevDataByStoreIdRpVo.setHeadImg(dxshAppUserInfo.getHeadImg());
                    getMinAppRevDataByStoreIdRpVo.setNewTime(dxshAppUserInfo.getNewTime());
                    //查询手机号
                    GetMidongdongUserDto getMidongdongUserDto = new GetMidongdongUserDto();
                    getMidongdongUserDto.setUserId(dxshAppUserChannel.getUserId());
                    RpcResponseVo rpcResponseVo = userRestService.getMidongdongUser(getMidongdongUserDto);
                    if (rpcResponseVo.isSuccess()) {
                        getMidongdongUserDto = rpcResponseVo.parseObject(GetMidongdongUserDto.class);
                        if (StringUtils.isNotBlank(getMidongdongUserDto.getPhone())) {
                            getMinAppRevDataByStoreIdRpVo.setPhone(getMidongdongUserDto.getPhone());
                        }
                    }
                }
            }
            //查询小程序信息
            try {
                if (StringUtils.isBlank(callToken)) {
                    RpcResponseVo rpcResponseVo = userRestService.getMinAppCallToken(dxshAppUserChannel.getUserId());
                    if (rpcResponseVo.isSuccess()) {
                        callToken = rpcResponseVo.getDataElement("token").toString();
                        log.info("tmp call token : {}", callToken);
                    }
                }
                if (StringUtils.isBlank(minitoken)) {
                    RpcResponseVo minrpcResponseVo = userRestService.getMiniTokenByUserId_v2(dxshAppUserChannel.getUserId(), callToken);
                    if (minrpcResponseVo.isSuccess()) {
                        minitoken = minrpcResponseVo.getData().toString();
                    }
                }
                List<String> minAppIds = new ArrayList<>();
                minAppIds.add(storeId);
                String url = AppConfig.getProperty("saas.dxshapp.center.service") + "/dxshApp/app/getByStoreIds";
                String requestBody = RestTemplateUtils.postForEntityForJsonByLoadBalanced(url, minAppIds, RestTemplateUtils.getSassHeader(minitoken));
                JSONObject userJson = JSON.parseObject(requestBody);
                if (userJson.containsKey("status") && ResultCode.CODE_NORMAL.equals(userJson.getString("status"))) {
                    JSONObject result = (JSONObject) userJson.get("data");
                    log.info("result:{}", JSON.toJSONString(result));
                    if (result != null) {
                        MinAppDto minAppDto = JSON.parseObject(result.getString(storeId), MinAppDto.class);
                        log.info("minAppDto:{}", JSON.toJSONString(minAppDto));
                        getMinAppRevDataByStoreIdRpVo.setMinAppName(minAppDto.getName());
                        getMinAppRevDataByStoreIdRpVo.setMinAppLogo(minAppDto.getLogo());
                        getMinAppRevDataByStoreIdRpVo.setMinAppIntro(minAppDto.getIntro());
                    }
                }
            } catch (Exception e) {
                log.error(e.getMessage(), e);
            }
            //查询资质信息
            DxshAppMinappAuth dxshAppMinappAuth = dxshAppMinappAuthService.getListByChannelIdAndUserId(dxshAppUserChannel.getId(), dxshAppUserChannel.getUserId());
            if (dxshAppMinappAuth != null) {
                BeanUtils.copyProperties(dxshAppMinappAuth, getMinAppRevDataByStoreIdRpVo, BeanUtils.getNullPropertyNames(dxshAppMinappAuth));
                if (StringUtils.isNotBlank(dxshAppMinappAuth.getPhone())) {
                    getMinAppRevDataByStoreIdRpVo.setLegalPhone(dxshAppMinappAuth.getPhone());
                }
            }
            //银行信息
            GetMinAppRevDataByStoreIdRpVo.BankData bankData = BeanUtils.copyProperties(dxshAppUserChannel, GetMinAppRevDataByStoreIdRpVo.BankData.class);
            getMinAppRevDataByStoreIdRpVo.setBankData(bankData);
            getMinAppRevDataByStoreIdRpVo.setStoreId(storeId);
            if(StringUtils.isNotBlank(appId)) {
                getMinAppRevDataByStoreIdRpVo.setAppId(appId);
            }
        }
        return ResultMapHelper.success(getMinAppRevDataByStoreIdRpVo,ResultMsg.MSG_GET_SUCCESS);
    }

    public String getMinitoken(Integer userId,String callToken){
        RpcResponseVo minrpcResponseVo = userRestService.getMiniTokenByUserId_v2(userId, callToken);
        if (minrpcResponseVo.isSuccess()) {
            return minrpcResponseVo.getData().toString();
        }
        return "";
    }

    public String getCalltoken(Integer userId){
        RpcResponseVo rpcResponseVo = userRestService.getMinAppCallToken(userId);;
        if(rpcResponseVo.isSuccess()){
            return rpcResponseVo.getDataElement("token").toString();
        }
        return "";
    }


    @Override
    public Map<String, Object> getTargetBusiness(DataBankBusinessVo dataBankBusinessVo) {
        Integer businessId = dataBankBusinessVo.getBusinessId();
        GetTargetBusinessRpVo getTargetBusinessRpVo = new GetTargetBusinessRpVo();
        if(businessId != null){
            RpcResponseVo rpcResponseVo = businessAuthRestService.getBusinessAuth(businessId);
            if(!rpcResponseVo.isSuccess()){
                return ResultMapHelper.result(ResultCode.CODE_ERROR_100,ResultMsg.HAND_FAIL);
            }

        }else {
            RpcResponseVo rpcResponseVo = businessAuthRestService.getUserClaimBusinessByUserIdPage(dataBankBusinessVo.getUserId(),1,1);
            if(!rpcResponseVo.isSuccess()){
                return ResultMapHelper.result(ResultCode.CODE_ERROR_100,ResultMsg.HAND_FAIL);
            }
        }
        return null;
    }

    @Override
    public Map<String, Object> getAppDemoList() {
        try {
            String postUrl = AppConfig.getProperty("saas.dxshapp.center.service.in") + "/dxshApp/app/getAppDemoList";
            String reponseBody = RestTemplateUtils.postForEntityForJsonByLoadBalanced(postUrl, new HashMap<>());
            if (StringUtils.isNotBlank(reponseBody)) {
                JSONObject reponseResult = JSON.parseObject(reponseBody);
                if (reponseResult.containsKey("status") && ResultCode.CODE_NORMAL.equals(reponseResult.getString("status"))) {
                    List<Map<String,Object>> data = (List<Map<String, Object>>) reponseResult.get("data");
                    if(CollectionUtils.isNotEmpty(data)){
                        for(Map<String,Object> d : data){
                            if(d.containsKey("demoId") && d.containsKey("templateId")){
                                d.put("templateId",d.get("demoId"));
                            }
                        }
                    }
                    return ResultMapHelper.success(JSON.toJSONString(data),ResultMsg.MSG_GET_SUCCESS);
                }
            }
        } catch (Exception e){
            log.error(e.getMessage(),e);
        }
        return ResultMapHelper.success(new ArrayList<>(),ResultMsg.MSG_GET_SUCCESS);
    }

    @Override
    public Map<String, Object> getAppDemoList_v2(BaseRqVo baseRqVo) {
        GetAppDemoList_v2RpVo getAppDemoList_v2RpVo = new GetAppDemoList_v2RpVo();
        GetAppDemoList_v2RpVo.MinAppDemo minAppDemo = new GetAppDemoList_v2RpVo.MinAppDemo();
//        minAppDemo.setDemoId("1");
//        minAppDemo.setTitle("模板名称显示一行");
//        minAppDemo.setPicture("http://dsp-1251624226.cos.ap-guangzhou.myqcloud.com/business/b202010261626464511404_s.jpg");
//        minAppDemo.setPriceDesc("￥6700.00/年");
//        getAppDemoList_v2RpVo.getMinAppDemos().add(minAppDemo);
//
//        minAppDemo = new GetAppDemoList_v2RpVo.MinAppDemo();
//        minAppDemo.setDemoId("2");
//        minAppDemo.setTitle("模板名称显示一行");
//        minAppDemo.setPicture("https://dsp-1251624226.cos.ap-guangzhou.myqcloud.com/dsp/20200818180137381_s.png");
//        minAppDemo.setPriceDesc("￥600.00/年");
//        getAppDemoList_v2RpVo.getMinAppDemos().add(minAppDemo);
//
//        minAppDemo = new GetAppDemoList_v2RpVo.MinAppDemo();
//        minAppDemo.setDemoId("3");
//        minAppDemo.setTitle("模板名称显示一行");
//        minAppDemo.setPicture("https://dsp-1251624226.cos.ap-guangzhou.myqcloud.com/dsp/20200818164145321_s.jpg");
//        minAppDemo.setPriceDesc("￥7500.00/年");
//        getAppDemoList_v2RpVo.getMinAppDemos().add(minAppDemo);
        String industryName = "";
        DxshAppIndustry dxshAppIndustry = dxshAppIndustryChooseService.getUserChooseInIndustry(baseRqVo.getUserId());
        if(dxshAppIndustry == null){
            Integer businessId = dankMerchantsDefBusinessService.getChooseBusinessId(baseRqVo.getUserId());
            if(businessId != null){
                BankBusinessBo bankBusinessBo = dataBankBusinessService.getChooseBusinessData(businessId);
                if(bankBusinessBo != null && StringUtils.isNotBlank(bankBusinessBo.getTypeName())){
                    if (BankBusinessController.industryTypeMap.containsKey(bankBusinessBo.getTypeName())) {
                        industryName = BankBusinessController.industryTypeMap.get(bankBusinessBo.getTypeName());
                    }
                }
            }
        }else {
            industryName = dxshAppIndustry.getIndustryName();
        }
        if(StringUtils.isBlank(industryName)){
            return ResultMapHelper.success(getAppDemoList_v2RpVo,ResultMsg.MSG_GET_SUCCESS);
        }
        if(dxshAppIndustry == null){
            dxshAppIndustry = dxshAppIndustryService.getIndustryByIndustryName(industryName);
            if(dxshAppIndustry == null){
                return ResultMapHelper.success(getAppDemoList_v2RpVo,ResultMsg.MSG_GET_SUCCESS);
            }
        }
        Map<String,Object> tempResultMap = this.getMinAppTemplList(baseRqVo.getUserId(),dxshAppIndustry.getId());
        if(ResultMapHelper.isSuccess(tempResultMap) ){
            JSONArray jsonArray = (JSONArray) tempResultMap.get("data");
            log.info("jsonArray ： {}",JSON.toJSONString(jsonArray));
            List<GetMinAppTemplListBo> getMinAppTemplListBos = JSON.parseArray(JSON.toJSONString(jsonArray),GetMinAppTemplListBo.class);
            postUpdateMinAppTempHander(getMinAppTemplListBos,getAppDemoList_v2RpVo);
        }
//        String str = "[{\"tmplId\":\"00000000751a7ff70175268bdb950034\",\"name\":\"美食行业模板（带直播）\",\"version\":\"1.00\",\"industry\":\"餐饮美食\",\"price\":100.0,\"codeId\":123456,\"preview\":\"\",\"serviceInfo\":null},{\"tmplId\":\"1000002\",\"name\":\"蛋糕小程序\",\"version\":\"1.10\",\"industry\":\"餐饮美食\",\"price\":50.0,\"codeId\":3,\"preview\":\"https://www.baidu.com\",\"serviceInfo\":[{\"tmplId\":\"1000002\",\"servicePackageId\":1,\"title\":\"小程序平台服务包\",\"subTitle\":null,\"previewImgUrl\":\"https://\",\"intro\":null,\"richText\":null,\"levelList\":[{\"levelId\":1,\"levelName\":\"体验版\",\"price\":0.0,\"discountPrice\":null,\"indate\":30,\"weight\":0,\"servicePackageId\":1,\"featureList\":[{\"id\":7,\"name\":\"营销工具\",\"paid\":1,\"icon\":null},{\"id\":12,\"name\":\"更新优惠券\",\"paid\":1,\"icon\":null},{\"id\":13,\"name\":\"储值规则设置\",\"paid\":1,\"icon\":null},{\"id\":14,\"name\":\"新建秒杀\",\"paid\":1,\"icon\":null},{\"id\":15,\"name\":\"编辑秒杀\",\"paid\":1,\"icon\":null},{\"id\":16,\"name\":\"会员卡级别更新\",\"paid\":1,\"icon\":null},{\"id\":17,\"name\":\"新建拼团\",\"paid\":1,\"icon\":null},{\"id\":18,\"name\":\"编辑拼团\",\"paid\":1,\"icon\":null},{\"id\":19,\"name\":\"会员成长值更新\",\"paid\":1,\"icon\":null},{\"id\":1,\"name\":\"会员管理\",\"paid\":1,\"icon\":null},{\"id\":2,\"name\":\"优惠券管理\",\"paid\":1,\"icon\":null},{\"id\":3,\"name\":\"储值管理\",\"paid\":1,\"icon\":null},{\"id\":4,\"name\":\"秒杀管理\",\"paid\":1,\"icon\":null},{\"id\":5,\"name\":\"拼团管理\",\"paid\":1,\"icon\":null},{\"id\":8,\"name\":\"余额充值\",\"paid\":1,\"icon\":null},{\"id\":9,\"name\":\"会员规则设置\",\"paid\":1,\"icon\":null},{\"id\":10,\"name\":\"会员卡级别生成\",\"paid\":1,\"icon\":null},{\"id\":11,\"name\":\"添加优惠券\",\"paid\":1,\"icon\":null}]},{\"levelId\":2,\"levelName\":\"尊享版\",\"price\":8888.0,\"discountPrice\":0.01,\"indate\":365,\"weight\":1,\"servicePackageId\":1,\"featureList\":[{\"id\":19,\"name\":\"会员成长值更新\",\"paid\":1,\"icon\":null},{\"id\":18,\"name\":\"编辑拼团\",\"paid\":1,\"icon\":null},{\"id\":17,\"name\":\"新建拼团\",\"paid\":1,\"icon\":null},{\"id\":16,\"name\":\"会员卡级别更新\",\"paid\":1,\"icon\":null},{\"id\":15,\"name\":\"编辑秒杀\",\"paid\":1,\"icon\":null},{\"id\":14,\"name\":\"新建秒杀\",\"paid\":1,\"icon\":null},{\"id\":13,\"name\":\"储值规则设置\",\"paid\":1,\"icon\":null},{\"id\":12,\"name\":\"更新优惠券\",\"paid\":1,\"icon\":null},{\"id\":11,\"name\":\"添加优惠券\",\"paid\":1,\"icon\":null},{\"id\":10,\"name\":\"会员卡级别生成\",\"paid\":1,\"icon\":null},{\"id\":9,\"name\":\"会员规则设置\",\"paid\":1,\"icon\":null},{\"id\":8,\"name\":\"余额充值\",\"paid\":1,\"icon\":null},{\"id\":7,\"name\":\"营销工具\",\"paid\":1,\"icon\":null},{\"id\":5,\"name\":\"拼团管理\",\"paid\":1,\"icon\":null},{\"id\":4,\"name\":\"秒杀管理\",\"paid\":1,\"icon\":null},{\"id\":3,\"name\":\"储值管理\",\"paid\":1,\"icon\":null},{\"id\":2,\"name\":\"优惠券管理\",\"paid\":1,\"icon\":null},{\"id\":1,\"name\":\"会员管理\",\"paid\":1,\"icon\":null}]}]}]},{\"tmplId\":\"ff8080817375ccd0017375f40bd70005\",\"name\":\"美食行业模板（勿删勿改）\",\"version\":\"1.00\",\"industry\":\"餐饮美食\",\"price\":123123.0,\"codeId\":2,\"preview\":\"http://168.168.3.231:8090/preview/ff8080817375ccd0017375f40bd70005/index.html\",\"serviceInfo\":null},{\"tmplId\":\"1000001\",\"name\":\"点餐小程序\",\"version\":\"1.00\",\"industry\":\"餐饮美食\",\"price\":50.0,\"codeId\":2,\"preview\":\"https://www.baidu.com\",\"serviceInfo\":[{\"tmplId\":\"1000001\",\"servicePackageId\":1,\"title\":\"小程序平台服务包\",\"subTitle\":null,\"previewImgUrl\":\"https://\",\"intro\":null,\"richText\":null,\"levelList\":[{\"levelId\":1,\"levelName\":\"体验版\",\"price\":0.0,\"discountPrice\":null,\"indate\":30,\"weight\":0,\"servicePackageId\":1,\"featureList\":[{\"id\":7,\"name\":\"营销工具\",\"paid\":1,\"icon\":null},{\"id\":12,\"name\":\"更新优惠券\",\"paid\":1,\"icon\":null},{\"id\":13,\"name\":\"储值规则设置\",\"paid\":1,\"icon\":null},{\"id\":14,\"name\":\"新建秒杀\",\"paid\":1,\"icon\":null},{\"id\":15,\"name\":\"编辑秒杀\",\"paid\":1,\"icon\":null},{\"id\":16,\"name\":\"会员卡级别更新\",\"paid\":1,\"icon\":null},{\"id\":17,\"name\":\"新建拼团\",\"paid\":1,\"icon\":null},{\"id\":18,\"name\":\"编辑拼团\",\"paid\":1,\"icon\":null},{\"id\":19,\"name\":\"会员成长值更新\",\"paid\":1,\"icon\":null},{\"id\":1,\"name\":\"会员管理\",\"paid\":1,\"icon\":null},{\"id\":2,\"name\":\"优惠券管理\",\"paid\":1,\"icon\":null},{\"id\":3,\"name\":\"储值管理\",\"paid\":1,\"icon\":null},{\"id\":4,\"name\":\"秒杀管理\",\"paid\":1,\"icon\":null},{\"id\":5,\"name\":\"拼团管理\",\"paid\":1,\"icon\":null},{\"id\":8,\"name\":\"余额充值\",\"paid\":1,\"icon\":null},{\"id\":9,\"name\":\"会员规则设置\",\"paid\":1,\"icon\":null},{\"id\":10,\"name\":\"会员卡级别生成\",\"paid\":1,\"icon\":null},{\"id\":11,\"name\":\"添加优惠券\",\"paid\":1,\"icon\":null}]},{\"levelId\":2,\"levelName\":\"尊享版\",\"price\":8888.0,\"discountPrice\":0.01,\"indate\":365,\"weight\":1,\"servicePackageId\":1,\"featureList\":[{\"id\":19,\"name\":\"会员成长值更新\",\"paid\":1,\"icon\":null},{\"id\":18,\"name\":\"编辑拼团\",\"paid\":1,\"icon\":null},{\"id\":17,\"name\":\"新建拼团\",\"paid\":1,\"icon\":null},{\"id\":16,\"name\":\"会员卡级别更新\",\"paid\":1,\"icon\":null},{\"id\":15,\"name\":\"编辑秒杀\",\"paid\":1,\"icon\":null},{\"id\":14,\"name\":\"新建秒杀\",\"paid\":1,\"icon\":null},{\"id\":13,\"name\":\"储值规则设置\",\"paid\":1,\"icon\":null},{\"id\":12,\"name\":\"更新优惠券\",\"paid\":1,\"icon\":null},{\"id\":11,\"name\":\"添加优惠券\",\"paid\":1,\"icon\":null},{\"id\":10,\"name\":\"会员卡级别生成\",\"paid\":1,\"icon\":null},{\"id\":9,\"name\":\"会员规则设置\",\"paid\":1,\"icon\":null},{\"id\":8,\"name\":\"余额充值\",\"paid\":1,\"icon\":null},{\"id\":7,\"name\":\"营销工具\",\"paid\":1,\"icon\":null},{\"id\":5,\"name\":\"拼团管理\",\"paid\":1,\"icon\":null},{\"id\":4,\"name\":\"秒杀管理\",\"paid\":1,\"icon\":null},{\"id\":3,\"name\":\"储值管理\",\"paid\":1,\"icon\":null},{\"id\":2,\"name\":\"优惠券管理\",\"paid\":1,\"icon\":null},{\"id\":1,\"name\":\"会员管理\",\"paid\":1,\"icon\":null}]}]}]}]";
//        List<GetMinAppTemplListBo> getMinAppTemplListBos = JSON.parseArray(str,GetMinAppTemplListBo.class);
//        postUpdateMinAppTempHander(getMinAppTemplListBos,getAppDemoList_v2RpVo);
        return ResultMapHelper.success(getAppDemoList_v2RpVo,ResultMsg.MSG_GET_SUCCESS);
    }

    private void postUpdateMinAppTempHander(List<GetMinAppTemplListBo> getMinAppTemplListBos, GetAppDemoList_v2RpVo getAppDemoList_v2RpVo) {
        if(CollectionUtils.isNotEmpty(getMinAppTemplListBos)) {
            for (GetMinAppTemplListBo getMinAppTemplListBo : getMinAppTemplListBos) {
                getMinAppTemplListBoMap.put(getMinAppTemplListBo.getTmplId(),getMinAppTemplListBo);
                GetAppDemoList_v2RpVo.MinAppDemo minAppDemo = new GetAppDemoList_v2RpVo.MinAppDemo();
                minAppDemo.setDemoId(getMinAppTemplListBo.getTmplId());
                minAppDemo.setTitle(getMinAppTemplListBo.getName());
                minAppDemo.setPreviewLink(getMinAppTemplListBo.getPreview());
                if(CollectionUtils.isNotEmpty(getMinAppTemplListBo.getServiceInfo())) {
                    minAppDemo.setPicture(getMinAppTemplListBo.getServiceInfo().get(0).getPreviewImgUrl());
                }
                if(CollectionUtils.isNotEmpty(getMinAppTemplListBo.getServiceInfo())){
                    List<GetMinAppTemplListBo.LevelList> levelLists = getMinAppTemplListBo.getServiceInfo().get(0).getLevelList();
                    if(CollectionUtils.isNotEmpty(levelLists)){
                        for(GetMinAppTemplListBo.LevelList levelList : levelLists){
                            if(levelList.getLevelName().equals("体验版")){
                                minAppDemo.setPriceDesc(String.format("￥%s/年",levelLists.get(0).getPrice()));
                                getMinAppTemplListBo.setPrice(minAppDemo.getPriceDesc());
                            }
                        }
                    }
                }
                getAppDemoList_v2RpVo.getMinAppDemos().add(minAppDemo);
            }
        }
    }

    private Map<String,Object> getMinAppTemplList(Integer userId,Integer industryId) {
        Map<String,Object> paramsMap = new HashMap<>();
        try {
            //TODO 调取鸿杰那边的接口创建小程序
            String postUrl = String.format(AppConfig.getProperty("saas.dxshapp.center.service") + "/dxshApp/app/getAppTmplList?industry=%s",industryId);
            String token = RequestHeaderData.getRequestHeaderData().getString("token");
            RpcResponseVo minrpcResponseVo = userRestService.getMiniTokenByUserId_v2(userId,
                    token);
            log.info("mdd-user 获取的小程序token：{}",minrpcResponseVo.getData().toString());
            String minitoken = minrpcResponseVo.getData().toString();
            String requestBody = RestTemplateUtils.postForEntityForJsonByLoadBalanced(postUrl,paramsMap,RestTemplateUtils.getSassHeader(minitoken));
            Map<String,Object> userJson = JSON.parseObject(requestBody);
            return userJson;

        }catch (Exception e) {
            log.error(e.getMessage(), e);
        }
        return ResultMapHelper.result(ResultCode.CODE_ERROR_100,ResultMsg.GET_FAIL);
    }

    @Override
    public DxshAppUserChannel getByMinAppId(String storeId) {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq(DxshAppUserChannel.MIN_APP_ID,storeId);
        List<DxshAppUserChannel> dxshAppUserChannels = dxshAppUserChannelMapper.selectList(queryWrapper);
        if(CollectionUtils.isNotEmpty(dxshAppUserChannels)){
            return dxshAppUserChannels.get(0);
        }
        return null;
    }

    @Override
    public List<DxshAppUserChannel> getDxshChannelByUserIdAndChannel(Integer userId, Integer channel) {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq(DxshAppUserChannel.USER_ID,userId);
        queryWrapper.eq(DxshAppUserChannel.CHANNEL,channel);
        List<DxshAppUserChannel> dxshAppUserChannels = dxshAppUserChannelMapper.selectList(queryWrapper);
        if(CollectionUtils.isNotEmpty(dxshAppUserChannels)){
            return dxshAppUserChannels;
        }
        return null;
    }

    @Override
    public DxshAppUserChannel getDxshChannelByBusinessIdAndChannel(Integer businessId, Integer channel) {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq(DxshAppUserChannel.BUSINESS_ID,businessId);
        queryWrapper.eq(DxshAppUserChannel.CHANNEL,channel);
        List<DxshAppUserChannel> dxshAppUserChannels = dxshAppUserChannelMapper.selectList(queryWrapper);
        if(CollectionUtils.isNotEmpty(dxshAppUserChannels)){
            return dxshAppUserChannels.get(0);
        }
        return null;
    }

    @Override
    public int countUserHaveBusiness(Integer userId) {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq(DxshAppUserChannel.USER_ID,userId);
        //queryWrapper.groupBy(DxshAppUserChannel.BUSINESS_ID);
        return this.count(queryWrapper);
    }

    public void syncDxshappCompMe() {
        RpcResponseVo rpcResponseVo = businessAuthRestService.getCertifiedStores();
        if(!rpcResponseVo.isSuccess()){
            return;
        }
        List<BmsUserBusinessAuth> bmsUserBusinessAuthList = rpcResponseVo.parseArray(BmsUserBusinessAuth.class);
        if(CollectionUtils.isNotEmpty(bmsUserBusinessAuthList)){
            List<DxshAppUserChannel> saveUserChannels = new ArrayList<>();
            for(BmsUserBusinessAuth bmsUserBusinessAuth : bmsUserBusinessAuthList){
                //老数据
                if(bmsUserBusinessAuth.getBmsBusinessId() != null) {
                    Integer businessAuthId = bmsUserBusinessAuth.getId();
                    QueryWrapper bWrapper = new QueryWrapper();
                    bWrapper.eq(DxshAppUserChannel.BUSINESS_AUTH_ID,businessAuthId);
                    bWrapper.eq(DxshAppUserChannel.CHANNEL, DxshAppUserChannelService.CHANNEL_MDD);
                    List<DxshAppUserChannel> dxshAppUserChannels = this.list(bWrapper);
                    DxshAppUserChannel dxshAppUserChannel = null;
                    if(!CollectionUtils.isNotEmpty(dxshAppUserChannels)){
                        //插入一个觅东东渠道数据
                        dxshAppUserChannel = new DxshAppUserChannel();
                        dxshAppUserChannel.setUserId(bmsUserBusinessAuth.getBmsUserId());
                        dxshAppUserChannel.setBusinessAuthId(businessAuthId);
                        dxshAppUserChannel.setBusinessId(bmsUserBusinessAuth.getBmsBusinessId());
                        dxshAppUserChannel.setChannel(DxshAppUserChannelService.CHANNEL_MDD);
                    }else {
                        dxshAppUserChannel = dxshAppUserChannels.get(0);
                    }
                    dxshAppUserChannel.setIsClaimShop(Constants.COMMON_FLAG_TRUE_INT);
                    if(bmsUserBusinessAuth.getStatus() == 2){
                        dxshAppUserChannel.setIsQualification(Constants.COMMON_FLAG_TRUE_INT);
                    }else if(bmsUserBusinessAuth.getStatus() == 3){
                        dxshAppUserChannel.setIsQualification(Constants.COMMON_FLAG_TRUE_INT);
                        dxshAppUserChannel.setQualificationStatus(1);
                    }
                    rpcResponseVo = businessInfoRestService.getBusinessInfo(dxshAppUserChannel.getBusinessId());
                    if(rpcResponseVo.isSuccess()){
                        GetBusinessInfoDto getBusinessInfoDto = rpcResponseVo.parseObject(GetBusinessInfoDto.class);
                        if(getBusinessInfoDto != null){
                            dxshAppUserChannel.setIsSubmitMddInfo(Constants.COMMON_FLAG_TRUE_INT);
                        }
                    }
                    saveUserChannels.add(dxshAppUserChannel);
                }
            }
            if(CollectionUtils.isNotEmpty(saveUserChannels)){
                this.saveOrUpdateBatch(saveUserChannels);
            }
        }
    }
}
